Java Code Examples for org.eclipse.swt.widgets.MessageBox#open()

The following examples show how to use org.eclipse.swt.widgets.MessageBox#open() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SftpPutDialog.java    From hop with Apache License 2.0 7 votes vote down vote up
@VisibleForTesting
boolean connectToSftp(boolean checkFolder, String Remotefoldername ) {
  boolean retval = true;
  try {
    if ( sftpclient == null || input.hasChanged() ) {
      sftpclient = createSftpClient();
    }
    if ( checkFolder ) {
      retval = sftpclient.folderExists( Remotefoldername );
    }

  } catch ( Exception e ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "SFTPPUT.ErrorConnect.NOK", wServerName.getText(), e
      .getMessage() )
      + Const.CR );
    mb.setText( BaseMessages.getString( PKG, "SFTPPUT.ErrorConnect.Title.Bad" ) );
    mb.open();
    retval = false;
  }
  return retval;
}
 
Example 2
Source File: ActionMysqlBulkFileDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void getTableName() {
  String databaseName = wConnection.getText();
  if ( StringUtils.isNotEmpty( databaseName ) ) {
    DatabaseMeta databaseMeta = workflowMeta.findDatabase( databaseName );
    if ( databaseMeta != null ) {
      DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, databaseMeta, workflowMeta.getDatabases() );
      std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() );
      if ( std.open() ) {
        // wSchemaname.setText(Const.NVL(std.getSchemaName(), ""));
        wTablename.setText( Const.NVL( std.getTableName(), "" ) );
      }
    } else {
      MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
      mb.setMessage( BaseMessages.getString( PKG, "JobMysqlBulkFile.ConnectionError2.DialogMessage" ) );
      mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
      mb.open();
    }
  }
}
 
Example 3
Source File: ActionSendNagiosPassiveCheckDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void ok() {
  if ( Utils.isEmpty( wName.getText() ) ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "System.Error.TransformNameMissing.Message" ) );
    mb.setText( BaseMessages.getString( PKG, "System.Error.TransformNameMissing.Title" ) );
    mb.open();
    return;
  }
  action.setName( wName.getText() );
  action.setPort( wPort.getText() );
  action.setServerName( wServerName.getText() );
  action.setConnectionTimeOut( wConnectionTimeOut.getText() );
  action.setResponseTimeOut( wResponseTimeOut.getText() );
  action.setSenderServerName( wSenderServerName.getText() );
  action.setSenderServiceName( wSenderServiceName.getText() );
  action.setMessage( wMessage.getText() );
  action.setEncryptionMode( ActionSendNagiosPassiveICheck.getEncryptionModeByDesc( wEncryptionMode.getText() ) );
  action.setLevel( ActionSendNagiosPassiveICheck.getLevelByDesc( wLevelMode.getText() ) );
  action.setPassword( wPassword.getText() );

  dispose();
}
 
Example 4
Source File: SasInputDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void ok() {
  if ( Utils.isEmpty( wTransformName.getText() ) ) {
    return;
  }

  try {
    transformName = wTransformName.getText(); // return value
    getInfo( input );
  } catch ( HopTransformException e ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( e.toString() );
    mb.setText( BaseMessages.getString( PKG, "System.Warning" ) );
    mb.open();
  }
  dispose();
}
 
Example 5
Source File: SQLFileOutputDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void getTableName() {
  String connectionName = wConnection.getText();
  if ( StringUtils.isEmpty( connectionName ) ) {
    return;
  }
  DatabaseMeta databaseMeta = pipelineMeta.findDatabase( connectionName );
  if ( databaseMeta != null ) {

    logDebug( BaseMessages.getString( PKG, "SQLFileOutputDialog.Log.LookingAtConnection", databaseMeta.toString() ) );

    DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, databaseMeta, pipelineMeta.getDatabases() );
    std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() );
    if ( std.open() ) {
      wSchema.setText( Const.NVL( std.getSchemaName(), "" ) );
      wTable.setText( Const.NVL( std.getTableName(), "" ) );
    }
  } else {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "SQLFileOutputDialog.ConnectionError2.DialogMessage" ) );
    mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
    mb.open();
  }

}
 
Example 6
Source File: ActionWriteToLogDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void ok() {
  if ( Utils.isEmpty( wName.getText() ) ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) );
    mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) );
    mb.open();
    return;
  }
  action.setName( wName.getText() );
  action.setLogMessage( wLogMessage.getText() );
  action.setLogSubject( wLogSubject.getText() );
  if ( wLoglevel.getSelectionIndex() != -1 ) {
    action.setEntryLogLevel( LogLevel.values()[ wLoglevel.getSelectionIndex() ] );
  }
  dispose();
}
 
Example 7
Source File: ScriptDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private boolean cancel() {
  if ( input.hasChanged() ) {
    MessageBox box = new MessageBox( shell, SWT.YES | SWT.NO | SWT.APPLICATION_MODAL );
    box.setText( BaseMessages.getString( PKG, "ScriptDialog.WarningDialogChanged.Title" ) );
    box.setMessage( BaseMessages.getString( PKG, "ScriptDialog.WarningDialogChanged.Message", Const.CR ) );
    int answer = box.open();

    if ( answer == SWT.NO ) {
      return false;
    }
  }
  transformName = null;
  input.setChanged( changed );
  dispose();
  return true;
}
 
Example 8
Source File: MySQLBulkLoaderDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void getTableName() {
  String connectionName = wConnection.getText();
  if ( StringUtils.isEmpty( connectionName ) ) {
    return;
  }
  DatabaseMeta databaseMeta = pipelineMeta.findDatabase( connectionName );
  if ( databaseMeta != null ) {
    if ( log.isDebug() ) {
      logDebug( BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.Log.LookingAtConnection" ) + databaseMeta.toString() );
    }

    DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, databaseMeta, pipelineMeta.getDatabases() );
    std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() );
    if ( std.open() ) {
      wSchema.setText( Const.NVL( std.getSchemaName(), "" ) );
      wTable.setText( Const.NVL( std.getTableName(), "" ) );
    }
  } else {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.InvalidConnection.DialogMessage" ) );
    mb.setText( BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.InvalidConnection.DialogTitle" ) );
    mb.open();
  }
}
 
Example 9
Source File: HopGuiPipelineGraph.java    From hop with Apache License 2.0 5 votes vote down vote up
@Override public boolean isCloseable() {
  try {
    // Check if the file is saved. If not, ask for it to be saved.
    //
    if ( pipelineMeta.hasChanged() ) {

      MessageBox messageDialog = new MessageBox( hopShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL );
      messageDialog.setText( "Save file?" );
      messageDialog.setMessage( "Do you want to save file '" + buildTabName() + "' before closing?" );
      int answer = messageDialog.open();
      if ( ( answer & SWT.YES ) != 0 ) {
        save();
        return true;
      }
      if ( ( answer & SWT.NO ) != 0 ) {
        // User doesn't want to save but close
        return true;
      }
      return false;
    } else {
      return true;
    }
  } catch ( Exception e ) {
    new ErrorDialog( hopShell(), "Error", "Error preparing file close", e );
  }
  return false;
}
 
Example 10
Source File: SqlStatementsDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void edit() {
  int idx = wFields.table.getSelectionIndex();
  if ( idx >= 0 ) {
    transformName = wFields.table.getItem( idx ).getText( 1 );
    dispose();
  } else {
    transformName = null;
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setText( BaseMessages.getString( PKG, "TransformFieldsDialog.OriginTransform.Title" ) );
    mb.setMessage( BaseMessages.getString( PKG, "TransformFieldsDialog.OriginTransform.Message" ) );
    mb.open();
  }
}
 
Example 11
Source File: ActionFtpsGetDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void checkRemoteFolder( boolean FtpsFolfer, boolean checkMoveFolder, String foldername ) {
  if ( !Utils.isEmpty( foldername ) ) {
    if ( connectToFtps( FtpsFolfer, checkMoveFolder ) ) {
      MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION );
      mb.setMessage( BaseMessages.getString( PKG, "JobFTPS.FolderExists.OK", foldername ) + Const.CR );
      mb.setText( BaseMessages.getString( PKG, "JobFTPS.FolderExists.Title.Ok" ) );
      mb.open();
    }
  }
}
 
Example 12
Source File: ActionSftpPutDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void test() {

    if ( connectToSftp( false, null ) ) {
      MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION );
      mb.setMessage( BaseMessages.getString( PKG, "JobSFTPPUT.Connected.OK", wServerName.getText() ) + Const.CR );
      mb.setText( BaseMessages.getString( PKG, "JobSFTPPUT.Connected.Title.Ok" ) );
      mb.open();
    }
  }
 
Example 13
Source File: ActionSftpDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void checkRemoteFolder() {
  String changeFtpFolder = workflowMeta.environmentSubstitute( wScpDirectory.getText() );
  if ( !Utils.isEmpty( changeFtpFolder ) ) {
    if ( connectToSftp( true, changeFtpFolder ) ) {
      MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION );
      mb.setMessage( BaseMessages.getString( PKG, "JobSFTP.FolderExists.OK", changeFtpFolder ) + Const.CR );
      mb.setText( BaseMessages.getString( PKG, "JobSFTP.FolderExists.Title.Ok" ) );
      mb.open();
    }
  }
}
 
Example 14
Source File: ActionFtpDeleteDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private boolean connectToFtps() {
  boolean retval = false;
  try {
    if ( ftpsclient == null ) {
      String realServername = workflowMeta.environmentSubstitute( wServerName.getText() );
      String realUsername = workflowMeta.environmentSubstitute( wUserName.getText() );
      String realPassword = Utils.resolvePassword( workflowMeta, wPassword.getText() );
      int port = Const.toInt( workflowMeta.environmentSubstitute( wPort.getText() ), 0 );

      // Create ftp client to host:port ...
      ftpsclient =
        new FtpsConnection(
          FtpsConnection.getConnectionTypeByDesc( wConnectionType.getText() ), realServername, port,
          realUsername, realPassword );

      if ( !Utils.isEmpty( wProxyHost.getText() ) ) {
        // Set proxy
        String realProxy_host = workflowMeta.environmentSubstitute( wProxyHost.getText() );
        String realProxy_user = workflowMeta.environmentSubstitute( wProxyUsername.getText() );
        String realProxy_pass = Utils.resolvePassword( workflowMeta, wProxyPassword.getText() );
        ftpsclient.setProxyHost( realProxy_host );
        int proxyport = Const.toInt( workflowMeta.environmentSubstitute( wProxyPort.getText() ), 990 );
        if ( proxyport != 0 ) {
          ftpsclient.setProxyPort( proxyport );
        }
        if ( !Utils.isEmpty( realProxy_user ) ) {
          ftpsclient.setProxyUser( realProxy_user );
        }
        if ( !Utils.isEmpty( realProxy_pass ) ) {
          ftpsclient.setProxyPassword( realProxy_pass );
        }
      }

      // login to FTPS host ...
      ftpsclient.connect();
      pwdFolder = ftpsclient.getWorkingDirectory();
    }
    retval = true;
  } catch ( Exception e ) {
    if ( ftpsclient != null ) {
      try {
        ftpsclient.disconnect();
      } catch ( Exception ignored ) {
        // We've tried quitting the FTPS Client exception
        // nothing else to be done if the FTPS Client was already disconnected
      }
      ftpsclient = null;
    }
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "JobFTPDelete.ErrorConnect.NOK", e.getMessage() ) + Const.CR );
    mb.setText( BaseMessages.getString( PKG, "JobFTPDelete.ErrorConnect.Title.Bad" ) );
    mb.open();
  }
  return retval;
}
 
Example 15
Source File: ActionFtpsGetDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private boolean connectToFtps(boolean checkfolder, boolean checkmoveToFolder ) {
  boolean retval = true;
  String realServername = null;
  try {
    if ( connection == null ) {
      // Create FTPS client to host:port ...
      realServername = workflowMeta.environmentSubstitute( wServerName.getText() );
      int port = Const.toInt( workflowMeta.environmentSubstitute( wPort.getText() ), 0 );
      String realUsername = workflowMeta.environmentSubstitute( wUserName.getText() );
      String realPassword = Utils.resolvePassword( workflowMeta, wPassword.getText() );

      connection =
        new FtpsConnection(
          FtpsConnection.getConnectionTypeByDesc( wConnectionType.getText() ), realServername, port,
          realUsername, realPassword );

      if ( !Utils.isEmpty( wProxyHost.getText() ) ) {
        // Set proxy
        String realProxy_host = workflowMeta.environmentSubstitute( wProxyHost.getText() );
        String realProxy_user = workflowMeta.environmentSubstitute( wProxyUsername.getText() );
        String realProxy_pass = Utils.resolvePassword( workflowMeta, wProxyPassword.getText() );
        connection.setProxyHost( realProxy_host );
        int proxyport = Const.toInt( workflowMeta.environmentSubstitute( wProxyPort.getText() ), 990 );
        if ( proxyport != 0 ) {
          connection.setProxyPort( proxyport );
        }
        if ( !Utils.isEmpty( realProxy_user ) ) {
          connection.setProxyUser( realProxy_user );
        }
        if ( !Utils.isEmpty( realProxy_pass ) ) {
          connection.setProxyPassword( realProxy_pass );
        }
      }

      // login to FTPS host ...
      connection.connect();
      // pwdFolder=connection.getWorkingDirectory();
    }

    String realFTPSDirectory = null;
    if ( !Utils.isEmpty( wFtpsDirectory.getText() ) ) {
      realFTPSDirectory = workflowMeta.environmentSubstitute( wFtpsDirectory.getText() );
    }

    if ( checkfolder ) {
      // if(pwdFolder!=null) connection.changeDirectory(pwdFolder);
      // move to spool dir ...
      if ( !Utils.isEmpty( realFTPSDirectory ) ) {
        // connection.changeDirectory(realFTPSDirectory);
        retval = connection.isDirectoryExists( realFTPSDirectory );
      }
    }
    if ( checkmoveToFolder ) {
      // if(pwdFolder!=null) connection.changeDirectory(pwdFolder);

      // move to folder ...

      if ( !Utils.isEmpty( wMoveToDirectory.getText() ) ) {
        String realMoveDirectory = workflowMeta.environmentSubstitute( wMoveToDirectory.getText() );
        // realMoveDirectory=realFTPSDirectory+"/"+realMoveDirectory;
        // connection.changeDirectory(realMoveDirectory);
        retval = connection.isDirectoryExists( realMoveDirectory );
      }
    }

  } catch ( Exception e ) {
    retval = false;
    if ( connection != null ) {
      try {
        connection.disconnect();
      } catch ( Exception ignored ) {
        // We've tried quitting the FTPS Client exception
        // nothing else to be done if the FTPS Client was already disconnected
      }
      connection = null;
    }
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "JobFTPS.ErrorConnect.NOK", realServername,
      e.getMessage() ) + Const.CR );
    mb.setText( BaseMessages.getString( PKG, "JobFTPS.ErrorConnect.Title.Bad" ) );
    mb.open();
  }
  return retval;
}
 
Example 16
Source File: ActionMssqlBulkLoadDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private void ok() {
  if ( Utils.isEmpty( wName.getText() ) ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) );
    mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) );
    mb.open();
    return;
  }
  action.setName( wName.getText() );
  action.setDatabase( workflowMeta.findDatabase( wConnection.getText() ) );
  action.setSchemaname( wSchemaname.getText() );
  action.setTablename( wTablename.getText() );
  action.setFilename( wFilename.getText() );
  action.setDataFileType( wDataFiletype.getText() );
  action.setFieldTerminator( wFieldTerminator.getText() );
  action.setLineterminated( wLineterminated.getText() );
  action.setCodePage( wCodePage.getText() );
  action.setSpecificCodePage( wSpecificCodePage.getText() );
  action.setFormatFilename( wFormatFilename.getText() );
  action.setFireTriggers( wFireTriggers.getSelection() );
  action.setCheckConstraints( wCheckConstraints.getSelection() );
  action.setKeepNulls( wKeepNulls.getSelection() );
  action.setKeepIdentity( wKeepIdentity.getSelection() );

  action.setTablock( wTablock.getSelection() );

  action.setStartFile( Const.toInt( wStartFile.getText(), 0 ) );
  action.setEndFile( Const.toInt( wEndFile.getText(), 0 ) );
  action.setOrderBy( wOrderBy.getText() );
  if ( wOrderDirection.getSelectionIndex() == 0 ) {
    action.setOrderDirection( "Asc" );
  } else {
    action.setOrderDirection( "Desc" );
  }

  action.setErrorFilename( wErrorFilename.getText() );
  action.setMaxErrors( Const.toInt( wMaxErrors.getText(), 0 ) );
  action.setBatchSize( Const.toInt( wBatchSize.getText(), 0 ) );
  action.setRowsPerBatch( Const.toInt( wRowsPerBatch.getText(), 0 ) );

  action.setAddDatetime( wAddDateTime.getSelection() );

  action.setAddFileToResult( wAddFileToResult.getSelection() );
  action.setTruncate( wTruncate.getSelection() );

  dispose();
}
 
Example 17
Source File: HopGuiWorkflowGraph.java    From hop with Apache License 2.0 4 votes vote down vote up
public static int showChangedWarning( Shell shell, String name ) {
  MessageBox mb = new MessageBox( shell, SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_WARNING );
  mb.setMessage( BaseMessages.getString( PKG, "WorkflowGraph.Dialog.PromptSave.Message", name ) );
  mb.setText( BaseMessages.getString( PKG, "WorkflowGraph.Dialog.PromptSave.Title" ) );
  return mb.open();
}
 
Example 18
Source File: HopGitPerspective.java    From hop with Apache License 2.0 4 votes vote down vote up
private void showMessageBox( String title, String message ) {
  MessageBox messageBox = new MessageBox( hopGui.getShell(), SWT.OK | SWT.ICON_INFORMATION );
  messageBox.setText( title );
  messageBox.setMessage( message );
  messageBox.open();
}
 
Example 19
Source File: ActionFtpDeleteDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private boolean connectToFtp() {
  boolean retval = false;
  String realServername = null;
  try {
    if ( ftpclient == null || !ftpclient.connected() ) {
      // Create ftp client to host:port ...
      ftpclient = new FTPClient();
      realServername = workflowMeta.environmentSubstitute( wServerName.getText() );
      int realPort = Const.toInt( workflowMeta.environmentSubstitute( wPort.getText() ), 21 );
      ftpclient.setRemoteAddr( InetAddress.getByName( realServername ) );
      ftpclient.setRemotePort( realPort );

      if ( !Utils.isEmpty( wProxyHost.getText() ) ) {
        String realProxy_host = workflowMeta.environmentSubstitute( wProxyHost.getText() );
        ftpclient.setRemoteAddr( InetAddress.getByName( realProxy_host ) );

        int port = Const.toInt( workflowMeta.environmentSubstitute( wProxyPort.getText() ), 21 );
        if ( port != 0 ) {
          ftpclient.setRemotePort( port );
        }
      }

      // login to ftp host ...
      ftpclient.connect();
      String realUsername =
        workflowMeta.environmentSubstitute( wUserName.getText() )
          + ( !Utils.isEmpty( wProxyHost.getText() ) ? "@" + realServername : "" )
          + ( !Utils.isEmpty( wProxyUsername.getText() ) ? " "
          + workflowMeta.environmentSubstitute( wProxyUsername.getText() ) : "" );

      String realPassword =
        Utils.resolvePassword( workflowMeta, wPassword.getText() )
          + ( !Utils.isEmpty( wProxyPassword.getText() ) ? " "
          + Utils.resolvePassword( workflowMeta, wProxyPassword.getText() ) : "" );
      // login now ...
      ftpclient.login( realUsername, realPassword );
      pwdFolder = ftpclient.pwd();
    }
    retval = true;
  } catch ( Exception e ) {
    if ( ftpclient != null ) {
      try {
        ftpclient.quit();
      } catch ( Exception ignored ) {
        // We've tried quitting the FTP Client exception
        // nothing else to be done if the FTP Client was already disconnected
      }
      ftpclient = null;
    }
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "JobFTPDelete.ErrorConnect.NOK", realServername,
      e.getMessage() ) + Const.CR );
    mb.setText( BaseMessages.getString( PKG, "JobFTPDelete.ErrorConnect.Title.Bad" ) );
    mb.open();
  }
  return retval;
}
 
Example 20
Source File: ActionCopyFilesDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
protected void ok() {
  if ( Utils.isEmpty( wName.getText() ) ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) );
    mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) );
    mb.open();
    return;
  }

  action.setName( wName.getText() );
  action.setCopyEmptyFolders( wCopyEmptyFolders.getSelection() );
  action.setoverwrite_files( wOverwriteFiles.getSelection() );
  action.setIncludeSubfolders( wIncludeSubfolders.getSelection() );
  action.setArgFromPrevious( wPrevious.getSelection() );
  action.setRemoveSourceFiles( wRemoveSourceFiles.getSelection() );
  action.setAddresultfilesname( wAddFileToResult.getSelection() );
  action.setDestinationIsAFile( wDestinationIsAFile.getSelection() );
  action.setCreateDestinationFolder( wCreateDestinationFolder.getSelection() );

  int nritems = wFields.nrNonEmpty();


  Map<String, String> sourceDestinationMappings = new HashMap<>();
  action.source_filefolder = new String[ nritems ];
  action.destination_filefolder = new String[ nritems ];
  action.wildcard = new String[ nritems ];

  for ( int i = 0; i < nritems; i++ ) {
    String sourceNc = wFields.getNonEmpty( i ).getText( 1 );
    sourceNc = sourceNc.equals( LOCAL_ENVIRONMENT ) ? ActionCopyFiles.LOCAL_SOURCE_FILE + i : sourceNc;
    sourceNc = sourceNc.equals( STATIC_ENVIRONMENT ) ? ActionCopyFiles.STATIC_SOURCE_FILE + i : sourceNc;
    String source = wFields.getNonEmpty( i ).getText( 2 );
    String wild = wFields.getNonEmpty( i ).getText( 3 );
    String destNc = wFields.getNonEmpty( i ).getText( 4 );
    destNc = destNc.equals( LOCAL_ENVIRONMENT ) ? ActionCopyFiles.LOCAL_DEST_FILE + i : destNc;
    destNc = destNc.equals( STATIC_ENVIRONMENT ) ? ActionCopyFiles.STATIC_DEST_FILE + i : destNc;
    String dest = wFields.getNonEmpty( i ).getText( 5 );
    source = ActionCopyFiles.SOURCE_URL + i + "-" + source;
    dest = ActionCopyFiles.DEST_URL + i + "-" + dest;
    action.source_filefolder[ i ] = action.loadURL( source, sourceNc, getMetadataProvider(), sourceDestinationMappings );
    action.destination_filefolder[ i ] = action.loadURL( dest, destNc, getMetadataProvider(), sourceDestinationMappings );
    action.wildcard[ i ] = wild;
  }
  action.setConfigurationMappings( sourceDestinationMappings );

  dispose();
}