gt:         fdlMove.left = new FormAttachment(0, 0);
context: /* Copyright (c) 2007 Pentaho Corporation.  All rights reserved. 
   * This software was developed by Pentaho Corporation and is provided under the terms 
   * of the GNU Lesser General Public License, Version 2.1. You may not use 
   * this file except in compliance with the license. If you need a copy of the license, 
   * please go to http://www.gnu.org/licenses/lgpl-2.1.txt. The Original Code is Pentaho 
   * Data Integration.  The Initial Developer is Pentaho Corporation.
   *
   * Software distributed under the GNU Lesser Public License is distributed on an "AS IS" 
   * basis, WITHOUT WARRANTY OF ANY KIND, either express or  implied. Please refer to 
   * the license for the specific language governing your rights and limitations.*/
  
  /*
   * Created on 19-jun-2003
   *
   */
  
  package org.pentaho.di.ui.job.entries.ftp;
  
  import java.net.InetAddress;
  import java.util.ArrayList;
  import java.util.List;
  
  import org.eclipse.swt.SWT;
  import org.eclipse.swt.custom.CCombo;
  import org.eclipse.swt.custom.CTabFolder;
  import org.eclipse.swt.custom.CTabItem;
  import org.eclipse.swt.events.ModifyEvent;
  import org.eclipse.swt.events.ModifyListener;
  import org.eclipse.swt.events.SelectionAdapter;
  import org.eclipse.swt.events.SelectionEvent;
  import org.eclipse.swt.events.ShellAdapter;
  import org.eclipse.swt.events.ShellEvent;
  import org.eclipse.swt.layout.FormAttachment;
  import org.eclipse.swt.layout.FormData;
  import org.eclipse.swt.layout.FormLayout;
  import org.eclipse.swt.widgets.Button;
  import org.eclipse.swt.widgets.Combo;
  import org.eclipse.swt.widgets.Composite;
  import org.eclipse.swt.widgets.DirectoryDialog;
  import org.eclipse.swt.widgets.Display;
  import org.eclipse.swt.widgets.Event;
  import org.eclipse.swt.widgets.Group;
  import org.eclipse.swt.widgets.Label;
  import org.eclipse.swt.widgets.Listener;
  import org.eclipse.swt.widgets.MessageBox;
  import org.eclipse.swt.widgets.Shell;
  import org.pentaho.di.core.Const;
  import org.pentaho.di.core.Props;
  import org.pentaho.di.core.util.StringUtil;
  import org.pentaho.di.i18n.BaseMessages;
  import org.pentaho.di.job.JobMeta;
  import org.pentaho.di.job.entries.ftp.JobEntryFTP;
  import org.pentaho.di.job.entry.JobEntryDialogInterface;
  import org.pentaho.di.job.entry.JobEntryInterface;
  import org.pentaho.di.repository.Repository;
  import org.pentaho.di.ui.core.gui.WindowProperty;
  import org.pentaho.di.ui.core.widget.LabelText;
  import org.pentaho.di.ui.core.widget.LabelTextVar;
  import org.pentaho.di.ui.core.widget.TextVar;
  import org.pentaho.di.ui.job.dialog.JobDialog;
  import org.pentaho.di.ui.job.entry.JobEntryDialog;
  import org.pentaho.di.ui.trans.step.BaseStepDialog;
  
  import com.enterprisedt.net.ftp.FTPClient;
  
  
  /**
   * This dialog allows you to edit the FTP Get job entry settings. 
   * 
   * @author Matt
   * @since 19-06-2003
   */
  
  public class JobEntryFTPDialog extends JobEntryDialog implements JobEntryDialogInterface
  {
  	private static Class<?> PKG = JobEntryFTP.class; // for i18n purposes, needed by Translator2!!   $NON-NLS-1$
  
      private LabelText wName;
  
      private FormData fdName;
  
      private LabelTextVar wServerName;
      
      private LabelTextVar wSocksProxyHost, wSocksProxyPort, wSocksProxyUsername, wSocksProxyPassword;
  
      private FormData fdServerName;
  
      private LabelTextVar wUserName;
  
      private FormData fdUserName;
  
      private LabelTextVar wPassword;
  
      private FormData fdPassword;
  
      private TextVar wFtpDirectory;
      private Label wlFtpDirectory;
  
      private FormData fdFtpDirectory;
      private FormData fdlFtpDirectory;
  
      private LabelTextVar wWildcard;
  
      private FormData fdWildcard;
  
      private Label wlBinaryMode;
  
      private Button wBinaryMode;
  
      private FormData fdlBinaryMode, fdBinaryMode;
  
      private LabelTextVar wTimeout;
  
      private FormData fdTimeout;
  
      private Label wlRemove;
  
      private Button wRemove;
  
      private FormData fdlRemove, fdRemove;
  
      private Label wlOnlyNew;
  
      private Button wOnlyNew;
  
      private FormData fdlOnlyNew, fdOnlyNew;
  
      private Label wlActive;
  
      private Button wActive;
  
      private FormData fdlActive, fdActive;
  
      private Button wOK, wCancel;
  
      private Listener lsOK, lsCancel;
  
      private JobEntryFTP jobEntry;
  
      private Shell shell;
  
      private SelectionAdapter lsDef;
      
      private Label        wlControlEncoding;
      
      private Combo        wControlEncoding;
      
      private FormData     fdlControlEncoding, fdControlEncoding;
  
      private boolean changed;
      
      private Label wlMove;
  
      private Button wMove;
      
      private Label wlMoveToDirectory;
      
      private FormData fdMove, fdlMove;
      
  
      private FormData fdMoveToDirectory,fdlMoveToDirectory;
      
      private TextVar wMoveToDirectory;
      
      private Label        wlSpecifyFormat;
      private Button       wSpecifyFormat;
      private FormData     fdlSpecifyFormat, fdSpecifyFormat;
  
      private Label        wlDateTimeFormat;
      private CCombo       wDateTimeFormat;
      private FormData     fdlDateTimeFormat, fdDateTimeFormat; 
      
      private Label        wlAddDate;
      private Button       wAddDate;
      private FormData     fdlAddDate, fdAddDate;
  
      private Label        wlAddTime;
      private Button       wAddTime;
      private FormData     fdlAddTime, fdAddTime;
      
  	private Label        wlAddDateBeforeExtension;
  	private Button       wAddDateBeforeExtension;
  	private FormData     fdlAddDateBeforeExtension, fdAddDateBeforeExtension;
  
  	
      
  	private Group wServerSettings;
  	private Group wSocksProxy;
      private FormData fdServerSettings;
      private FormData fdSocksProxyComp;
      
  	private Group wLocalSettings;
      private FormData fdLocalSettings;
      
  	private CTabFolder   wTabFolder;
  	private Composite    wGeneralComp,wFilesComp,wAdvancedComp,wSocksProxyComp;	
  	private CTabItem     wGeneralTab,wFilesTab,wAdvancedTab,wSocksProxyTab;
  	private FormData	 fdGeneralComp,fdFilesComp,fdAdvancedComp;
  	private FormData     fdTabFolder;
  	
      private LabelTextVar wProxyHost;
      
      private FormData     fdPort;
  
      private LabelTextVar wPort;
  
  
      private FormData     fdProxyHost;
  
      private FormData     fdSocksProxyHost, fdSocksProxyPort, fdSocksProxyUsername, fdSocksProxyPassword;
  
      private LabelTextVar wProxyPort;
  
      private FormData     fdProxyPort;
  
      private LabelTextVar wProxyUsername;
  
      private FormData     fdProxyUsername;
      
      private LabelTextVar wProxyPassword;
      
      private FormData     fdProxyPasswd;
      
  	private Button wTest;
  	
  	private FormData fdTest;
  	
  	private Listener lsTest;
  	
  	private Listener lsCheckFolder;
  	
  	private Listener lsCheckChangeFolder;
  	
  	private Group wAdvancedSettings;
      private FormData fdAdvancedSettings;
      
  	private Group wRemoteSettings;
      private FormData fdRemoteSettings;
      
      private Label wlAddFilenameToResult;
  
      private Button wAddFilenameToResult;
  
      private FormData fdlAddFilenameToResult, fdAddFilenameToResult;
      
      private Label wlTargetDirectory;
      private TextVar wTargetDirectory;
      private FormData fdlTargetDirectory, fdTargetDirectory;
      
      private Button wbTargetDirectory;
      private FormData fdbTargetDirectory;   
      
  	private Label wlIfFileExists;
  	private  CCombo wIfFileExists;
  	private FormData fdlIfFileExists, fdIfFileExists;
  	
  	private Button wbTestFolderExists;
  	private FormData fdbTestFolderExists;
  	
  	private Button wCreateMoveFolder;
  	private Label wlCreateMoveFolder;
  	private FormData fdCreateMoveFolder;
  	private FormData fdlCreateMoveFolder;
  	
  	private Button wbTestChangeFolderExists;
  	private FormData fdbTestChangeFolderExists;
  	
  	private Group wSuccessOn;
      private FormData fdSuccessOn;
      
  	
  	private Label wlNrErrorsLessThan;
  	private TextVar wNrErrorsLessThan;
  	private FormData fdlNrErrorsLessThan, fdNrErrorsLessThan;
  	
  	private Label wlSuccessCondition;
  	private CCombo wSuccessCondition;
  	private FormData fdlSuccessCondition, fdSuccessCondition;
  	
  	private FTPClient ftpclient = null;
  	private String pwdFolder=null;
      
      // These should not be translated, they are required to exist on all
      // platforms according to the documentation of "Charset".
      private static String[] encodings = { "US-ASCII",
      	                                  "ISO-8859-1",
      	                                  "UTF-8",
      	                                  "UTF-16BE",
      	                                  "UTF-16LE",
      	                                  "UTF-16" }; 
  
      //
      // Original code used to fill encodings, this display all possibilities but
      // takes 10 seconds on my pc to fill.
      //
      // static {
      //     SortedMap charsetMap = Charset.availableCharsets();
      //    Set charsetSet = charsetMap.keySet();
      //    encodings = (String [])charsetSet.toArray(new String[0]);
      // }
  
      public JobEntryFTPDialog(Shell parent, JobEntryInterface jobEntryInt, Repository rep, JobMeta jobMeta)
      {
          super(parent, jobEntryInt, rep, jobMeta);
          jobEntry = (JobEntryFTP) jobEntryInt;
          if (this.jobEntry.getName() == null)
              this.jobEntry.setName(BaseMessages.getString(PKG, "JobFTP.Name.Default"));
      }
  
  
      public JobEntryInterface open()
      {
          Shell parent = getParent();
          Display display = parent.getDisplay();
  
          shell = new Shell(parent, props.getJobsDialogStyle());
          props.setLook(shell);
          JobDialog.setShellImage(shell, jobEntry);
  
          ModifyListener lsMod = new ModifyListener()
          {
              public void modifyText(ModifyEvent e)
              {
              	pwdFolder=null;
              	ftpclient=null;
                  jobEntry.setChanged();
              }
          };
          changed = jobEntry.hasChanged();
  
          FormLayout formLayout = new FormLayout();
          formLayout.marginWidth = Const.FORM_MARGIN;
          formLayout.marginHeight = Const.FORM_MARGIN;
  
          shell.setLayout(formLayout);
          shell.setText(BaseMessages.getString(PKG, "JobFTP.Title"));
  
          int middle = props.getMiddlePct();
          int margin = Const.MARGIN;
  
          // Job entry name line
          wName = new LabelText(shell, BaseMessages.getString(PKG, "JobFTP.Name.Label"), 
          		BaseMessages.getString(PKG, "JobFTP.Name.Tooltip"));
          wName.addModifyListener(lsMod);
          fdName = new FormData();
          fdName.top = new FormAttachment(0, 0);
          fdName.left = new FormAttachment(0, 0);
          fdName.right = new FormAttachment(100, 0);
          wName.setLayoutData(fdName);
          
          
          wTabFolder = new CTabFolder(shell, SWT.BORDER);
   		props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
   		
   		//////////////////////////
  		// START OF GENERAL TAB   ///
  		//////////////////////////
  		
  		
  		
  		wGeneralTab=new CTabItem(wTabFolder, SWT.NONE);
  		wGeneralTab.setText(BaseMessages.getString(PKG, "JobFTP.Tab.General.Label"));
  		
  		wGeneralComp = new Composite(wTabFolder, SWT.NONE);
   		props.setLook(wGeneralComp);
  
  		FormLayout generalLayout = new FormLayout();
  		generalLayout.marginWidth  = 3;
  		generalLayout.marginHeight = 3;
  		wGeneralComp.setLayout(generalLayout);
          
  	     // ////////////////////////
  	     // START OF SERVER SETTINGS GROUP///
  	     // /
  	    wServerSettings = new Group(wGeneralComp, SWT.SHADOW_NONE);
  	    props.setLook(wServerSettings);
  	    wServerSettings.setText(BaseMessages.getString(PKG, "JobFTP.ServerSettings.Group.Label"));
  
  	    FormLayout ServerSettingsgroupLayout = new FormLayout();
  	    ServerSettingsgroupLayout.marginWidth = 10;
  	    ServerSettingsgroupLayout.marginHeight = 10;
  
  	    wServerSettings.setLayout(ServerSettingsgroupLayout);
  
          // ServerName line
          wServerName = new LabelTextVar(jobMeta,wServerSettings, BaseMessages.getString(PKG, "JobFTP.Server.Label"), 
          		BaseMessages.getString(PKG, "JobFTP.Server.Tooltip"));
          props.setLook(wServerName);
          wServerName.addModifyListener(lsMod);
          fdServerName = new FormData();
          fdServerName.left = new FormAttachment(0, 0);
          fdServerName.top = new FormAttachment(wName, margin);
          fdServerName.right = new FormAttachment(100, 0);
          wServerName.setLayoutData(fdServerName);
          
          // Server port line
          wPort = new LabelTextVar(jobMeta,wServerSettings, BaseMessages.getString(PKG, "JobFTP.Port.Label"), BaseMessages.getString(PKG, "JobFTP.Port.Tooltip"));
          props.setLook(wPort);
          wPort.addModifyListener(lsMod);
          fdPort = new FormData();
          fdPort.left 	= new FormAttachment(0, 0);
          fdPort.top  	= new FormAttachment(wServerName, margin);
          fdPort.right	= new FormAttachment(100, 0);
          wPort.setLayoutData(fdPort);
  
          // UserName line
          wUserName = new LabelTextVar(jobMeta,wServerSettings, BaseMessages.getString(PKG, "JobFTP.User.Label"), 
          		BaseMessages.getString(PKG, "JobFTP.User.Tooltip"));
          props.setLook(wUserName);
          wUserName.addModifyListener(lsMod);
          fdUserName = new FormData();
          fdUserName.left = new FormAttachment(0, 0);
          fdUserName.top = new FormAttachment(wPort, margin);
          fdUserName.right = new FormAttachment(100, 0);
          wUserName.setLayoutData(fdUserName);
  
          // Password line
          wPassword = new LabelTextVar(jobMeta,wServerSettings, BaseMessages.getString(PKG, "JobFTP.Password.Label"), 
          		BaseMessages.getString(PKG, "JobFTP.Password.Tooltip"));
          props.setLook(wPassword);
          wPassword.setEchoChar('*');
          wPassword.addModifyListener(lsMod);
          fdPassword = new FormData();
          fdPassword.left = new FormAttachment(0, 0);
          fdPassword.top = new FormAttachment(wUserName, margin);
          fdPassword.right = new FormAttachment(100, 0);
          wPassword.setLayoutData(fdPassword);
  
          // OK, if the password contains a variable, we don't want to have the password hidden...
          wPassword.getTextWidget().addModifyListener(new ModifyListener()
          {
              public void modifyText(ModifyEvent e)
              {
                  checkPasswordVisible();
              }
          });
  
          
          // Proxy host line
          wProxyHost = new LabelTextVar(jobMeta,wServerSettings, BaseMessages.getString(PKG, "JobFTP.ProxyHost.Label"), BaseMessages.getString(PKG, "JobFTP.ProxyHost.Tooltip"));
          props.setLook(wProxyHost);
          wProxyHost.addModifyListener(lsMod);
          fdProxyHost = new FormData();
          fdProxyHost.left 	= new FormAttachment(0, 0);
          fdProxyHost.top		= new FormAttachment(wPassword, 2*margin);
          fdProxyHost.right	= new FormAttachment(100, 0);
          wProxyHost.setLayoutData(fdProxyHost);
  
          // Proxy port line
          wProxyPort = new LabelTextVar(jobMeta,wServerSettings, BaseMessages.getString(PKG, "JobFTP.ProxyPort.Label"), BaseMessages.getString(PKG, "JobFTP.ProxyPort.Tooltip"));
          props.setLook(wProxyPort);
          wProxyPort.addModifyListener(lsMod);
          fdProxyPort = new FormData();
          fdProxyPort.left 	= new FormAttachment(0, 0);
          fdProxyPort.top  	= new FormAttachment(wProxyHost, margin);
          fdProxyPort.right	= new FormAttachment(100, 0);
          wProxyPort.setLayoutData(fdProxyPort);
  
          // Proxy username line
          wProxyUsername = new LabelTextVar(jobMeta,wServerSettings, BaseMessages.getString(PKG, "JobFTP.ProxyUsername.Label"), BaseMessages.getString(PKG, "JobFTP.ProxyUsername.Tooltip"));
          props.setLook(wProxyUsername);
          wProxyUsername.addModifyListener(lsMod);
          fdProxyUsername = new FormData();
          fdProxyUsername.left = new FormAttachment(0, 0);
          fdProxyUsername.top  = new FormAttachment(wProxyPort, margin);
          fdProxyUsername.right= new FormAttachment(100, 0);
          wProxyUsername.setLayoutData(fdProxyUsername);
          
          // Proxy password line
          wProxyPassword = new LabelTextVar(jobMeta,wServerSettings, BaseMessages.getString(PKG, "JobFTP.ProxyPassword.Label"), BaseMessages.getString(PKG, "JobFTP.ProxyPassword.Tooltip"));
          props.setLook(wProxyPassword);
          wProxyPassword.setEchoChar('*');
          wProxyPassword.addModifyListener(lsMod);
          fdProxyPasswd=new FormData();
          fdProxyPasswd.left = new FormAttachment(0, 0);
          fdProxyPasswd.top  = new FormAttachment(wProxyUsername, margin);
          fdProxyPasswd.right= new FormAttachment(100, 0);
          wProxyPassword.setLayoutData(fdProxyPasswd);
          
          // OK, if the password contains a variable, we don't want to have the password hidden...
          wProxyPassword.getTextWidget().addModifyListener(new ModifyListener()
          {
              public void modifyText(ModifyEvent e)
              {
                  checkProxyPasswordVisible();
              }
          });
          
  		// Test connection button
  		wTest=new Button(wServerSettings,SWT.PUSH);
  		wTest.setText(BaseMessages.getString(PKG, "JobFTP.TestConnection.Label"));
   		props.setLook(wTest);
  		fdTest=new FormData();
  		wTest.setToolTipText(BaseMessages.getString(PKG, "JobFTP.TestConnection.Tooltip"));
  		//fdTest.left = new FormAttachment(middle, 0);
  		fdTest.top  = new FormAttachment(wProxyPassword, margin);
  		fdTest.right= new FormAttachment(100, 0);
  		wTest.setLayoutData(fdTest);
          
          
  	     fdServerSettings = new FormData();
  	     fdServerSettings.left = new FormAttachment(0, margin);
  	     fdServerSettings.top = new FormAttachment(wName, margin);
  	     fdServerSettings.right = new FormAttachment(100, -margin);
  	     wServerSettings.setLayoutData(fdServerSettings);
  	     // ///////////////////////////////////////////////////////////
  	     // / END OF SERVER SETTINGS GROUP
  	     // ///////////////////////////////////////////////////////////
          
  
  	     // ////////////////////////
  	     // START OF Advanced SETTINGS GROUP///
  	     // /
  	     wAdvancedSettings = new Group(wGeneralComp, SWT.SHADOW_NONE);
  	     props.setLook(wAdvancedSettings);
  	     wAdvancedSettings.setText(BaseMessages.getString(PKG, "JobFTP.AdvancedSettings.Group.Label"));
  	     FormLayout AdvancedSettingsgroupLayout = new FormLayout();
  	     AdvancedSettingsgroupLayout.marginWidth = 10;
  	     AdvancedSettingsgroupLayout.marginHeight = 10;
  	     wAdvancedSettings.setLayout(AdvancedSettingsgroupLayout);
  
  	    
  	     // Binary mode selection...
          wlBinaryMode = new Label(wAdvancedSettings, SWT.RIGHT);
          wlBinaryMode.setText(BaseMessages.getString(PKG, "JobFTP.BinaryMode.Label"));
          props.setLook(wlBinaryMode);
          fdlBinaryMode = new FormData();
          fdlBinaryMode.left = new FormAttachment(0, 0);
          fdlBinaryMode.top = new FormAttachment(wServerSettings, margin);
          fdlBinaryMode.right = new FormAttachment(middle, 0);
          wlBinaryMode.setLayoutData(fdlBinaryMode);
          wBinaryMode = new Button(wAdvancedSettings, SWT.CHECK);
          props.setLook(wBinaryMode);
          wBinaryMode.setToolTipText(BaseMessages.getString(PKG, "JobFTP.BinaryMode.Tooltip"));
          fdBinaryMode = new FormData();
          fdBinaryMode.left = new FormAttachment(middle, margin);
          fdBinaryMode.top = new FormAttachment(wServerSettings, margin);
          fdBinaryMode.right = new FormAttachment(100, 0);
          wBinaryMode.setLayoutData(fdBinaryMode);
  
          // Timeout line
          wTimeout = new LabelTextVar(jobMeta,wAdvancedSettings, BaseMessages.getString(PKG, "JobFTP.Timeout.Label"), 
          		BaseMessages.getString(PKG, "JobFTP.Timeout.Tooltip"));
          props.setLook(wTimeout);
          wTimeout.addModifyListener(lsMod);
          fdTimeout = new FormData();
          fdTimeout.left = new FormAttachment(0, 0);
          fdTimeout.top = new FormAttachment(wlBinaryMode, margin);
          fdTimeout.right = new FormAttachment(100, 0);
          wTimeout.setLayoutData(fdTimeout);
  
  
          // active connection?
          wlActive = new Label(wAdvancedSettings, SWT.RIGHT);
          wlActive.setText(BaseMessages.getString(PKG, "JobFTP.ActiveConns.Label"));
          props.setLook(wlActive);
          fdlActive = new FormData();
          fdlActive.left = new FormAttachment(0, 0);
          fdlActive.top = new FormAttachment(wTimeout, margin);
          fdlActive.right = new FormAttachment(middle, 0);
          wlActive.setLayoutData(fdlActive);
          wActive = new Button(wAdvancedSettings, SWT.CHECK);
          wActive.setToolTipText(BaseMessages.getString(PKG, "JobFTP.ActiveConns.Tooltip"));
          props.setLook(wActive);
          fdActive = new FormData();
          fdActive.left = new FormAttachment(middle, margin);
          fdActive.top = new FormAttachment(wTimeout, margin);
          fdActive.right = new FormAttachment(100, 0);
          wActive.setLayoutData(fdActive);
          
          // Control encoding line
          //
          // The drop down is editable as it may happen an encoding may not be present
          // on one machine, but you may want to use it on your execution server
          //
          wlControlEncoding=new Label(wAdvancedSettings, SWT.RIGHT);
          wlControlEncoding.setText(BaseMessages.getString(PKG, "JobFTP.ControlEncoding.Label"));
          props.setLook(wlControlEncoding);
          fdlControlEncoding=new FormData();
          fdlControlEncoding.left  = new FormAttachment(0, 0);
          fdlControlEncoding.top   = new FormAttachment(wActive, margin);
          fdlControlEncoding.right = new FormAttachment(middle, 0);
          wlControlEncoding.setLayoutData(fdlControlEncoding);
          wControlEncoding=new Combo(wAdvancedSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
          wControlEncoding.setToolTipText(BaseMessages.getString(PKG, "JobFTP.ControlEncoding.Tooltip"));
          wControlEncoding.setItems(encodings);
          props.setLook(wControlEncoding);
          fdControlEncoding=new FormData();
          fdControlEncoding.left = new FormAttachment(middle, margin);
          fdControlEncoding.top  = new FormAttachment(wActive, margin);
          fdControlEncoding.right= new FormAttachment(100, 0);        
          wControlEncoding.setLayoutData(fdControlEncoding);
      
  	    
  	     fdAdvancedSettings = new FormData();
  	     fdAdvancedSettings.left = new FormAttachment(0, margin);
  	     fdAdvancedSettings.top = new FormAttachment(wServerSettings, margin);
  	     fdAdvancedSettings.right = new FormAttachment(100, -margin);
  	     wAdvancedSettings.setLayoutData(fdAdvancedSettings);
  	     // ///////////////////////////////////////////////////////////
  	     // / END OF Advanced SETTINGS GROUP
  	     // ///////////////////////////////////////////////////////////
  
  		fdGeneralComp=new FormData();
  		fdGeneralComp.left  = new FormAttachment(0, 0);
  		fdGeneralComp.top   = new FormAttachment(0, 0);
  		fdGeneralComp.right = new FormAttachment(100, 0);
  		fdGeneralComp.bottom= new FormAttachment(100, 0);
  		wGeneralComp.setLayoutData(fdGeneralComp);
  		
  		wGeneralComp.layout();
  		wGeneralTab.setControl(wGeneralComp);
   		props.setLook(wGeneralComp);
   		
   		
   		
  		/////////////////////////////////////////////////////////////
  		/// END OF GENERAL TAB
  		/////////////////////////////////////////////////////////////
  		
   		//////////////////////////
  		// START OF Files TAB   ///
  		//////////////////////////
  		
   		wFilesTab=new CTabItem(wTabFolder, SWT.NONE);
  		wFilesTab.setText(BaseMessages.getString(PKG, "JobFTP.Tab.Files.Label"));
  		
  		wFilesComp = new Composite(wTabFolder, SWT.NONE);
   		props.setLook(wFilesComp);
  
  		FormLayout FilesLayout = new FormLayout();
  		FilesLayout.marginWidth  = 3;
  		FilesLayout.marginHeight = 3;
  		wFilesComp.setLayout(FilesLayout);
   		
  		 // ////////////////////////
  	     // START OF Remote SETTINGS GROUP///
  	     // /
  	    wRemoteSettings = new Group(wFilesComp, SWT.SHADOW_NONE);
  	    props.setLook(wRemoteSettings);
  	    wRemoteSettings.setText(BaseMessages.getString(PKG, "JobFTP.RemoteSettings.Group.Label"));
  
  	    FormLayout RemoteSettinsgroupLayout = new FormLayout();
  	    RemoteSettinsgroupLayout.marginWidth = 10;
  	    RemoteSettinsgroupLayout.marginHeight = 10;
  
  	    wRemoteSettings.setLayout(RemoteSettinsgroupLayout);
  	    
  	    
          // Move to directory
          wlFtpDirectory = new Label(wRemoteSettings, SWT.RIGHT);
          wlFtpDirectory.setText(BaseMessages.getString(PKG, "JobFTP.RemoteDir.Label"));
          props.setLook(wlFtpDirectory);
          fdlFtpDirectory= new FormData();
          fdlFtpDirectory.left = new FormAttachment(0, 0);
          fdlFtpDirectory.top = new FormAttachment(0, margin);
          fdlFtpDirectory.right = new FormAttachment(middle, 0);
          wlFtpDirectory.setLayoutData(fdlFtpDirectory);
  	    
  	    // Test remote folder  button ...
  		wbTestChangeFolderExists=new Button(wRemoteSettings, SWT.PUSH| SWT.CENTER);
  		props.setLook(wbTestChangeFolderExists);
  		wbTestChangeFolderExists.setText(BaseMessages.getString(PKG, "JobFTP.TestFolderExists.Label"));
  		fdbTestChangeFolderExists=new FormData();
  		fdbTestChangeFolderExists.right= new FormAttachment(100, 0);
  		fdbTestChangeFolderExists.top  = new FormAttachment(0, margin);
  		wbTestChangeFolderExists.setLayoutData(fdbTestChangeFolderExists);
  
          wFtpDirectory = new TextVar(jobMeta,wRemoteSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER, 
          		BaseMessages.getString(PKG, "JobFTP.RemoteDir.Tooltip"));
         props.setLook(wFtpDirectory);
         wFtpDirectory.addModifyListener(lsMod);
         fdFtpDirectory = new FormData();
         fdFtpDirectory.left = new FormAttachment(middle, margin);
         fdFtpDirectory.top = new FormAttachment(0, margin);
         fdFtpDirectory.right = new FormAttachment(wbTestChangeFolderExists, -margin);
         wFtpDirectory.setLayoutData(fdFtpDirectory);
         
          
          // Wildcard line
          wWildcard = new LabelTextVar(jobMeta,wRemoteSettings, BaseMessages.getString(PKG, "JobFTP.Wildcard.Label"), 
          		BaseMessages.getString(PKG, "JobFTP.Wildcard.Tooltip"));
          props.setLook(wWildcard);
          wWildcard.addModifyListener(lsMod);
          fdWildcard = new FormData();
          fdWildcard.left = new FormAttachment(0, 0);
          fdWildcard.top = new FormAttachment(wFtpDirectory, margin);
          fdWildcard.right = new FormAttachment(100, 0);
          wWildcard.setLayoutData(fdWildcard);
          
          // Remove files after retrieval...
          wlRemove = new Label(wRemoteSettings, SWT.RIGHT);
          wlRemove.setText(BaseMessages.getString(PKG, "JobFTP.RemoveFiles.Label"));
          props.setLook(wlRemove);
          fdlRemove = new FormData();
          fdlRemove.left = new FormAttachment(0, 0);
          fdlRemove.top = new FormAttachment(wWildcard, margin);
          fdlRemove.right = new FormAttachment(middle, 0);
          wlRemove.setLayoutData(fdlRemove);
          wRemove = new Button(wRemoteSettings, SWT.CHECK);
          wRemove.setToolTipText(BaseMessages.getString(PKG, "JobFTP.RemoveFiles.Tooltip"));
          props.setLook(wRemove);
          fdRemove = new FormData();
          fdRemove.left = new FormAttachment(middle, margin);
          fdRemove.top = new FormAttachment(wWildcard, margin);
          fdRemove.right = new FormAttachment(100, 0);
          wRemove.setLayoutData(fdRemove);
          
          wRemove.addSelectionListener(new SelectionAdapter()
  		{
  			public void widgetSelected(SelectionEvent e)
  			{
  				if(wRemove.getSelection())
  				{
  					wMove.setSelection(false);
  					activateMoveTo();
  				}
  				
  			}
  		});
          
          // Move files after the transfert?...
          wlMove = new Label(wRemoteSettings, SWT.RIGHT);
          wlMove.setText(BaseMessages.getString(PKG, "JobFTP.MoveFiles.Label"));
          props.setLook(wlMove);
          fdlMove = new FormData();
  