HOP-3684 : Clean up the Neo4j connection dialog
diff --git a/docs/hop-user-manual/modules/ROOT/pages/metadata-types/neo4j/neo4j-connection.adoc b/docs/hop-user-manual/modules/ROOT/pages/metadata-types/neo4j/neo4j-connection.adoc
index 673684c..42af773 100644
--- a/docs/hop-user-manual/modules/ROOT/pages/metadata-types/neo4j/neo4j-connection.adoc
+++ b/docs/hop-user-manual/modules/ROOT/pages/metadata-types/neo4j/neo4j-connection.adoc
@@ -16,6 +16,7 @@
 ////
 :documentationPath: /metadata-types/neo4j/
 :language: en_US
+:toc:
 
 = Neo4j Connection
 
@@ -24,15 +25,17 @@
 Connections can be created and edited using the logo (click on it to edit), and the drop down menu (arrow down) which you can find on the right of every connection line on the various Neo4j dialogs.
 
 They can also be managed with the metadata perspective in the Hop GUI.
-Finally, please note that Neo4j Connections are serialized as JSON in the Hop metadata folder under
+
+Neo4j Connections are serialized as JSON in the Hop metadata folder under
 
 `metadata/neo4j-connection/`
 
-== The dialog
+== The user interface
 
-**DON'T PANIC**: most of the options in the interface you don't need (...and most likely will never will need).
+In most cases the Neo4j https://neo4j.com/docs/java-manual/current/get-started/[driver] can figure out the protocol and security options automatically allowing you to focus on the most elementary options: server, port, username and password.
+As per usual we recommend that you never hardcode any settings but use environment variables which you can define in an environment configuration file.  This way the same Neo4j connection can be used in multiple environments without the need to change pipelines or workflows.
 
-== The Options
+== The Basic options
 
 |===
 |Option |Description
@@ -40,20 +43,36 @@
 |Connection name
 |The name of a connection uniquely identifying it
 
+|Automatic?
+|If you enable this option you ask the driver to automatically determine protocol options like encryption and routing.
+
 |Server or IP Address
 |The IP address or hostname used to reach the Neo4j server.
 If you have more than one server address to specify, use a comma separated list of hosts.
 
-|Database Name (4.0)
+|Database Name
 |The database to use (defaults to neo4j).
-A feature available on plugins version 5.0 or higher against Neo4j server 4.0 or higher.
+A feature available in Neo4j server 4.0 or higher.
+
+|Database port
+|The Neo4j database port to connect to.  If you leave this blank it uses the default port number: 7687.
+
+|Username
+|the Neo4j database user to log in with
+
+|Password
+|the password to use
+
+|===
+
+== The Protocol options
+
+|===
+|Option |Description
 
 |Version 4 database?
 |Enable this option to help us generate the most optimized Cypher for you.
 
-|Bolt port
-|the Neo4j Bolt protocol port, default is 7687
-
 |Browser port
 |information only.
 The port on which the Neo4j browser runs
@@ -64,12 +83,6 @@
 |Routing policy
 |The bolt+routing policy to use
 
-|Username
-|the Neo4j database user to log in with
-
-|Password
-|the password to use
-
 |Use encryption?
 |Unless you generated and configured the correct SSL keys, disable this.
 Make sure to check our v4 upgrade notes
@@ -78,11 +91,14 @@
 
 == Aura
 
-To connect to an Aura version 4 database we would set the following options:
+To connect to an Aura version 4 database you can use the following options:
 
 |===
 |Option |Value
 
+|Automatic?
+|Disabled
+
 |Server or IP address
 |the provided ....neo4j.io hostname
 
@@ -108,7 +124,7 @@
 |the provided password
 |===
 
-== The advanced options
+== The Advanced options
 
 === Connection Liveliness Check Timeout (ms)
 
diff --git a/plugins/tech/neo4j/pom.xml b/plugins/tech/neo4j/pom.xml
index 16f4f3c..41ceeac 100755
--- a/plugins/tech/neo4j/pom.xml
+++ b/plugins/tech/neo4j/pom.xml
@@ -44,7 +44,7 @@
     </licenses>
 
     <properties>
-        <neo4j.driver.version>4.3.4</neo4j.driver.version>
+        <neo4j.driver.version>4.4.2</neo4j.driver.version>
     </properties>
 
     <repositories>
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/shared/NeoConnection.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/shared/NeoConnection.java
index e89de70..e52ec0c 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/shared/NeoConnection.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/shared/NeoConnection.java
@@ -25,6 +25,7 @@
 import org.apache.hop.core.row.value.ValueMetaString;
 import org.apache.hop.core.util.Utils;
 import org.apache.hop.core.variables.IVariables;
+import org.apache.hop.core.xml.XmlHandler;
 import org.apache.hop.metadata.api.HopMetadata;
 import org.apache.hop.metadata.api.HopMetadataBase;
 import org.apache.hop.metadata.api.HopMetadataProperty;
@@ -92,11 +93,16 @@
 
   @HopMetadataProperty private String version4Variable;
 
+  @HopMetadataProperty private boolean automatic;
+
+  @HopMetadataProperty private String automaticVariable;
+
   public NeoConnection() {
     boltPort = "7687";
     browserPort = "7474";
     manualUrls = new ArrayList<>();
     version4 = true;
+    automatic = true;
   }
 
   public NeoConnection(IVariables parent) {
@@ -128,6 +134,8 @@
     this.maxTransactionRetryTime = source.maxTransactionRetryTime;
     this.version4 = source.version4;
     this.version4Variable = source.version4Variable;
+    this.automatic = source.automatic;
+    this.automaticVariable = source.automaticVariable;
   }
 
   @Override
@@ -239,11 +247,12 @@
     /*
      * Construct the following URL:
      *
+     * neo4://hostname:port
      * bolt://hostname:port
      * bolt+routing://core-server:port/?policy=MyPolicy
      */
     String url = "";
-    if (isUsingRouting(variables)) {
+    if (isAutomatic(variables) || isUsingRouting(variables)) {
       url += "neo4j";
     } else {
       url += "bolt";
@@ -261,7 +270,12 @@
     }
 
     String routingPolicyString = variables.resolve(routingPolicy);
-    if (isUsingRouting(variables) && StringUtils.isNotEmpty(routingPolicyString)) {
+
+    // We don't add these options if the automatic flag is set
+    //
+    if (!isAutomatic(variables)
+        && isUsingRouting(variables)
+        && StringUtils.isNotEmpty(routingPolicyString)) {
       try {
         url += "?policy=" + URLEncoder.encode(routingPolicyString, "UTF-8");
       } catch (Exception e) {
@@ -334,14 +348,19 @@
       String realUsername = variables.resolve(username);
       String realPassword = Encr.decryptPasswordOptionallyEncrypted(variables.resolve(password));
       Config.ConfigBuilder configBuilder;
-      if (encryptionVariableSet(variables) || usingEncryption) {
-        configBuilder = Config.builder().withEncryption();
-        if (trustAllCertificatesVariableSet(variables) || trustAllCertificates) {
-          configBuilder =
-              configBuilder.withTrustStrategy(Config.TrustStrategy.trustAllCertificates());
+
+      if (!isAutomatic(variables)) {
+        if (encryptionVariableSet(variables) || usingEncryption) {
+          configBuilder = Config.builder().withEncryption();
+          if (trustAllCertificatesVariableSet(variables) || trustAllCertificates) {
+            configBuilder =
+                configBuilder.withTrustStrategy(Config.TrustStrategy.trustAllCertificates());
+          }
+        } else {
+          configBuilder = Config.builder().withoutEncryption();
         }
       } else {
-        configBuilder = Config.builder().withoutEncryption();
+        configBuilder = Config.builder();
       }
       if (StringUtils.isNotEmpty(connectionLivenessCheckTimeout)) {
         long seconds = Const.toLong(variables.resolve(connectionLivenessCheckTimeout), -1L);
@@ -413,6 +432,23 @@
   }
 
   /**
+   * Checks both the automaticVariable String and automatic boolean to see if this connection is to
+   * be configured automatically.
+   *
+   * @param variables Used to resolve variable expressions
+   * @return True if the connection is to be configured automatically.
+   */
+  public boolean isAutomatic(IVariables variables) {
+    if (StringUtils.isEmpty(automaticVariable)) {
+      return isAutomatic();
+    } else {
+      String automaticString = variables.resolve(automaticVariable);
+      Boolean auto = ValueMetaString.convertStringToBoolean(automaticString);
+      return auto != null && auto;
+    }
+  }
+
+  /**
    * Gets name
    *
    * @return value of name
@@ -735,4 +771,32 @@
   public void setVersion4Variable(String version4Variable) {
     this.version4Variable = version4Variable;
   }
+
+  /**
+   * If a connection is set to automatic the Neo4j Java driver figures out encryption and routing
+   * settings automatically. It results in using a neo4j://hostname:port URL
+   *
+   * @return True if the Neo4j connection is automatic
+   */
+  public boolean isAutomatic() {
+    return automatic;
+  }
+
+  /** @param automatic The automatic flag to be set. */
+  public void setAutomatic(boolean automatic) {
+    this.automatic = automatic;
+  }
+
+  /** @return A variable expression which allows you to enable or disable the automatic flag */
+  public String getAutomaticVariable() {
+    return automaticVariable;
+  }
+
+  /**
+   * @param automaticVariable The variable expression to set which allows you to enable or disable
+   *     the automatic flag
+   */
+  public void setAutomaticVariable(String automaticVariable) {
+    this.automaticVariable = automaticVariable;
+  }
 }
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/shared/NeoConnectionEditor.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/shared/NeoConnectionEditor.java
index 532e03a..42fa4cc 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/shared/NeoConnectionEditor.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/shared/NeoConnectionEditor.java
@@ -29,8 +29,11 @@
 import org.apache.hop.ui.hopgui.HopGui;
 import org.apache.hop.ui.hopgui.perspective.metadata.MetadataPerspective;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
@@ -40,21 +43,29 @@
 public class NeoConnectionEditor extends MetadataEditor<NeoConnection> {
   private static final Class<?> PKG = NeoConnectionEditor.class; // for Translator2
 
+  private CTabFolder wTabFolder;
+
   // Connection properties
   //
   private Text wName;
+  private Label wlAutomatic;
+  private CheckBoxVar wAutomatic;
   private Label wlServer;
   private TextVar wServer;
   private Label wlDatabaseName;
   private TextVar wDatabaseName;
+  private Label wlDatabasePort;
+  private TextVar wDatabasePort;
+  private TextVar wUsername;
+  private TextVar wPassword;
+
+  // Advanced
+  //
+  private Label wlVersion4;
   private CheckBoxVar wVersion4;
-  private Label wlBoltPort;
-  private TextVar wBoltPort;
   private TextVar wBrowserPort;
   private Label wlPolicy;
   private TextVar wPolicy;
-  private TextVar wUsername;
-  private TextVar wPassword;
   private Label wlRouting;
   private CheckBoxVar wRouting;
   private Label wlEncryption;
@@ -62,7 +73,6 @@
   private Label wlTrustAllCertificates;
   private CheckBoxVar wTrustAllCertificates;
 
-  private Group gAdvanced;
   private TextVar wConnectionLivenessCheckTimeout;
   private TextVar wMaxConnectionLifetime;
   private TextVar wMaxConnectionPoolSize;
@@ -102,10 +112,96 @@
     fdName.left = new FormAttachment(middle, 0); // To the right of the label
     fdName.right = new FormAttachment(95, 0);
     wName.setLayoutData(fdName);
-    Control lastControl = wName;
+
+    wTabFolder = new CTabFolder(composite, SWT.BORDER);
+    FormData fdTabFolder = new FormData();
+    fdTabFolder.left = new FormAttachment(0, 0);
+    fdTabFolder.right = new FormAttachment(100, 0);
+    fdTabFolder.top = new FormAttachment(wName, 2 * margin);
+    fdTabFolder.bottom = new FormAttachment(100, -2 * margin);
+    wTabFolder.setLayoutData(fdTabFolder);
+
+    addBasicTab(props, variables, middle, margin);
+    addProtocolTab(props, variables, middle, margin);
+    addAdvancedTab(props, variables, middle, margin);
+    addUrlsTab(props, variables);
+
+    // Always select the basic tab
+    wTabFolder.setSelection(0);
+
+    setWidgetsContent();
+    enableFields();
+
+    clearChanged();
+
+    // Add modify listeners to all controls.
+    // This will inform the Metadata perspective in the Hop GUI that this object was modified and
+    // needs to be saved.
+    //
+    Control[] controls = {
+      wName,
+      wAutomatic,
+      wServer,
+      wDatabaseName,
+      wVersion4,
+      wDatabasePort,
+      wBrowserPort,
+      wPolicy,
+      wUsername,
+      wRouting,
+      wEncryption,
+      wTrustAllCertificates,
+      wConnectionLivenessCheckTimeout,
+      wMaxConnectionLifetime,
+      wMaxConnectionPoolSize,
+      wConnectionAcquisitionTimeout,
+      wConnectionTimeout,
+      wMaxTransactionRetryTime,
+    };
+    for (Control control : controls) {
+      control.addListener(SWT.Modify, e -> setChanged());
+      control.addListener(SWT.Selection, e -> setChanged());
+    }
+  }
+
+  private void addBasicTab(PropsUi props, IVariables variables, int middle, int margin) {
+    CTabItem wModelTab = new CTabItem(wTabFolder, SWT.NONE);
+    wModelTab.setText("Basic   ");
+    ScrolledComposite wBasicSComp = new ScrolledComposite(wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
+    wBasicSComp.setLayout(new FillLayout());
+
+    Composite wBasicComp = new Composite(wBasicSComp, SWT.NONE);
+    props.setLook(wBasicComp);
+
+    FormLayout formLayout = new FormLayout();
+    formLayout.marginWidth = 3;
+    formLayout.marginHeight = 3;
+    wBasicComp.setLayout(formLayout);
+
+    // Automatic?
+    wlAutomatic = new Label(wBasicComp, SWT.RIGHT);
+    wlAutomatic.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Automatic.Label"));
+    wlAutomatic.setToolTipText(
+        BaseMessages.getString(PKG, "NeoConnectionEditor.Automatic.Tooltip"));
+    props.setLook(wlAutomatic);
+    FormData fdlAutomatic = new FormData();
+    fdlAutomatic.top = new FormAttachment(0, margin);
+    fdlAutomatic.left = new FormAttachment(0, 0);
+    fdlAutomatic.right = new FormAttachment(middle, -margin);
+    wlAutomatic.setLayoutData(fdlAutomatic);
+    wAutomatic = new CheckBoxVar(variables, wBasicComp, SWT.CHECK);
+    wAutomatic.setToolTipText(BaseMessages.getString(PKG, "NeoConnectionEditor.Automatic.Tooltip"));
+    props.setLook(wAutomatic);
+    FormData fdAutomatic = new FormData();
+    fdAutomatic.top = new FormAttachment(wlAutomatic, 0, SWT.CENTER);
+    fdAutomatic.left = new FormAttachment(middle, 0);
+    fdAutomatic.right = new FormAttachment(95, 0);
+    wAutomatic.setLayoutData(fdAutomatic);
+    wAutomatic.addListener(SWT.Selection, e -> enableFields());
+    Control lastControl = wAutomatic;
 
     // The server
-    wlServer = new Label(composite, SWT.RIGHT);
+    wlServer = new Label(wBasicComp, SWT.RIGHT);
     props.setLook(wlServer);
     wlServer.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Server.Label"));
     FormData fdlServer = new FormData();
@@ -113,7 +209,7 @@
     fdlServer.left = new FormAttachment(0, 0); // First one in the left top corner
     fdlServer.right = new FormAttachment(middle, -margin);
     wlServer.setLayoutData(fdlServer);
-    wServer = new TextVar(variables, composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    wServer = new TextVar(variables, wBasicComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
     props.setLook(wServer);
     FormData fdServer = new FormData();
     fdServer.top = new FormAttachment(wlServer, 0, SWT.CENTER);
@@ -123,7 +219,7 @@
     lastControl = wServer;
 
     // The DatabaseName
-    wlDatabaseName = new Label(composite, SWT.RIGHT);
+    wlDatabaseName = new Label(wBasicComp, SWT.RIGHT);
     props.setLook(wlDatabaseName);
     wlDatabaseName.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.DatabaseName.Label"));
     FormData fdlDatabaseName = new FormData();
@@ -131,7 +227,7 @@
     fdlDatabaseName.left = new FormAttachment(0, 0); // First one in the left top corner
     fdlDatabaseName.right = new FormAttachment(middle, -margin);
     wlDatabaseName.setLayoutData(fdlDatabaseName);
-    wDatabaseName = new TextVar(variables, composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    wDatabaseName = new TextVar(variables, wBasicComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
     props.setLook(wDatabaseName);
     FormData fdDatabaseName = new FormData();
     fdDatabaseName.top = new FormAttachment(wlDatabaseName, 0, SWT.CENTER);
@@ -140,106 +236,26 @@
     wDatabaseName.setLayoutData(fdDatabaseName);
     lastControl = wDatabaseName;
 
-    // Version4?
-    Label wlVersion4 = new Label(composite, SWT.RIGHT);
-    wlVersion4.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Version4.Label"));
-    props.setLook(wlVersion4);
-    FormData fdlVersion4 = new FormData();
-    fdlVersion4.top = new FormAttachment(lastControl, margin);
-    fdlVersion4.left = new FormAttachment(0, 0);
-    fdlVersion4.right = new FormAttachment(middle, -margin);
-    wlVersion4.setLayoutData(fdlVersion4);
-    wVersion4 = new CheckBoxVar(variables, composite, SWT.CHECK);
-    props.setLook(wVersion4);
-    FormData fdVersion4 = new FormData();
-    fdVersion4.top = new FormAttachment(wlVersion4, 0, SWT.CENTER);
-    fdVersion4.left = new FormAttachment(middle, 0);
-    fdVersion4.right = new FormAttachment(95, 0);
-    wVersion4.setLayoutData(fdVersion4);
-    lastControl = wVersion4;
-
-    // Bolt port?
-    wlBoltPort = new Label(composite, SWT.RIGHT);
-    props.setLook(wlBoltPort);
-    wlBoltPort.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.BoltPort.Label"));
-    FormData fdlBoltPort = new FormData();
-    fdlBoltPort.top = new FormAttachment(lastControl, margin);
-    fdlBoltPort.left = new FormAttachment(0, 0); // First one in the left top corner
-    fdlBoltPort.right = new FormAttachment(middle, -margin);
-    wlBoltPort.setLayoutData(fdlBoltPort);
-    wBoltPort = new TextVar(variables, composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wBoltPort);
-    FormData fdBoltPort = new FormData();
-    fdBoltPort.top = new FormAttachment(wlBoltPort, 0, SWT.CENTER);
-    fdBoltPort.left = new FormAttachment(middle, 0); // To the right of the label
-    fdBoltPort.right = new FormAttachment(95, 0);
-    wBoltPort.setLayoutData(fdBoltPort);
-    lastControl = wBoltPort;
-
-    // Browser port?
-    Label wlBrowserPort = new Label(composite, SWT.RIGHT);
-    props.setLook(wlBrowserPort);
-    wlBrowserPort.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.BrowserPort.Label"));
-    FormData fdlBrowserPort = new FormData();
-    fdlBrowserPort.top = new FormAttachment(lastControl, margin);
-    fdlBrowserPort.left = new FormAttachment(0, 0); // First one in the left top corner
-    fdlBrowserPort.right = new FormAttachment(middle, -margin);
-    wlBrowserPort.setLayoutData(fdlBrowserPort);
-    wBrowserPort = new TextVar(variables, composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wBrowserPort);
-    FormData fdBrowserPort = new FormData();
-    fdBrowserPort.top = new FormAttachment(wlBrowserPort, 0, SWT.CENTER);
-    fdBrowserPort.left = new FormAttachment(middle, 0); // To the right of the label
-    fdBrowserPort.right = new FormAttachment(95, 0);
-    wBrowserPort.setLayoutData(fdBrowserPort);
-    lastControl = wBrowserPort;
-
-    // Https
-    wlRouting = new Label(composite, SWT.RIGHT);
-    wlRouting.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Routing.Label"));
-    props.setLook(wlRouting);
-    FormData fdlRouting = new FormData();
-    fdlRouting.top = new FormAttachment(lastControl, margin);
-    fdlRouting.left = new FormAttachment(0, 0);
-    fdlRouting.right = new FormAttachment(middle, -margin);
-    wlRouting.setLayoutData(fdlRouting);
-    wRouting = new CheckBoxVar(variables, composite, SWT.CHECK);
-    props.setLook(wRouting);
-    FormData fdRouting = new FormData();
-    fdRouting.top = new FormAttachment(wlRouting, 0, SWT.CENTER);
-    fdRouting.left = new FormAttachment(middle, 0);
-    fdRouting.right = new FormAttachment(95, 0);
-    wRouting.setLayoutData(fdRouting);
-    lastControl = wRouting;
-
-    // Policy
-    wlPolicy = new Label(composite, SWT.RIGHT);
-    wlPolicy.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Policy.Label"));
-    props.setLook(wlPolicy);
-    FormData fdlPolicy = new FormData();
-    fdlPolicy.top = new FormAttachment(lastControl, margin);
-    fdlPolicy.left = new FormAttachment(0, 0);
-    fdlPolicy.right = new FormAttachment(middle, -margin);
-    wlPolicy.setLayoutData(fdlPolicy);
-    wPolicy = new TextVar(variables, composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wPolicy);
-    FormData fdPolicy = new FormData();
-    fdPolicy.top = new FormAttachment(wlPolicy, 0, SWT.CENTER);
-    fdPolicy.left = new FormAttachment(middle, 0);
-    fdPolicy.right = new FormAttachment(95, 0);
-    wPolicy.setLayoutData(fdPolicy);
-    lastControl = wPolicy;
-
-    wRouting.addSelectionListener(
-        new SelectionAdapter() {
-          @Override
-          public void widgetSelected(SelectionEvent selectionEvent) {
-            enableFields();
-          }
-        });
+    // Database port?
+    wlDatabasePort = new Label(wBasicComp, SWT.RIGHT);
+    props.setLook(wlDatabasePort);
+    wlDatabasePort.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.DatabasePort.Label"));
+    FormData fdlDatabasePort = new FormData();
+    fdlDatabasePort.top = new FormAttachment(lastControl, margin);
+    fdlDatabasePort.left = new FormAttachment(0, 0); // First one in the left top corner
+    fdlDatabasePort.right = new FormAttachment(middle, -margin);
+    wlDatabasePort.setLayoutData(fdlDatabasePort);
+    wDatabasePort = new TextVar(variables, wBasicComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wDatabasePort);
+    FormData fdDatabasePort = new FormData();
+    fdDatabasePort.top = new FormAttachment(wlDatabasePort, 0, SWT.CENTER);
+    fdDatabasePort.left = new FormAttachment(middle, 0); // To the right of the label
+    fdDatabasePort.right = new FormAttachment(95, 0);
+    wDatabasePort.setLayoutData(fdDatabasePort);
+    lastControl = wDatabasePort;
 
     // Username
-    Label wlUsername = new Label(composite, SWT.RIGHT);
+    Label wlUsername = new Label(wBasicComp, SWT.RIGHT);
     wlUsername.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.UserName.Label"));
     props.setLook(wlUsername);
     FormData fdlUsername = new FormData();
@@ -247,7 +263,7 @@
     fdlUsername.left = new FormAttachment(0, 0);
     fdlUsername.right = new FormAttachment(middle, -margin);
     wlUsername.setLayoutData(fdlUsername);
-    wUsername = new TextVar(variables, composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    wUsername = new TextVar(variables, wBasicComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
     props.setLook(wUsername);
     FormData fdUsername = new FormData();
     fdUsername.top = new FormAttachment(wlUsername, 0, SWT.CENTER);
@@ -257,25 +273,127 @@
     lastControl = wUsername;
 
     // Password
-    Label wlPassword = new Label(composite, SWT.RIGHT);
+    Label wlPassword = new Label(wBasicComp, SWT.RIGHT);
     wlPassword.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Password.Label"));
     props.setLook(wlPassword);
     FormData fdlPassword = new FormData();
-    fdlPassword.top = new FormAttachment(wUsername, margin);
+    fdlPassword.top = new FormAttachment(lastControl, margin);
     fdlPassword.left = new FormAttachment(0, 0);
     fdlPassword.right = new FormAttachment(middle, -margin);
     wlPassword.setLayoutData(fdlPassword);
-    wPassword = new PasswordTextVar(variables, composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    wPassword = new PasswordTextVar(variables, wBasicComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
     props.setLook(wPassword);
     FormData fdPassword = new FormData();
     fdPassword.top = new FormAttachment(wlPassword, 0, SWT.CENTER);
     fdPassword.left = new FormAttachment(middle, 0);
     fdPassword.right = new FormAttachment(95, 0);
     wPassword.setLayoutData(fdPassword);
-    lastControl = wPassword;
+
+    // End of the basic tab...
+    //
+    wBasicComp.pack();
+
+    Rectangle bounds = wBasicComp.getBounds();
+
+    wBasicSComp.setContent(wBasicComp);
+    wBasicSComp.setExpandHorizontal(true);
+    wBasicSComp.setExpandVertical(true);
+    wBasicSComp.setMinWidth(bounds.width);
+    wBasicSComp.setMinHeight(bounds.height);
+
+    wModelTab.setControl(wBasicSComp);
+  }
+
+  private void addProtocolTab(PropsUi props, IVariables variables, int middle, int margin) {
+    CTabItem wProtocolTab = new CTabItem(wTabFolder, SWT.NONE);
+    wProtocolTab.setText("Protocol   ");
+    ScrolledComposite wProtocolSComp =
+        new ScrolledComposite(wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
+    wProtocolSComp.setLayout(new FillLayout());
+
+    Composite wProtocolComp = new Composite(wProtocolSComp, SWT.NONE);
+    props.setLook(wProtocolComp);
+
+    FormLayout formLayout = new FormLayout();
+    formLayout.marginWidth = 3;
+    formLayout.marginHeight = 3;
+    wProtocolComp.setLayout(formLayout);
+
+    // Version4?
+    wlVersion4 = new Label(wProtocolComp, SWT.RIGHT);
+    wlVersion4.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Version4.Label"));
+    props.setLook(wlVersion4);
+    FormData fdlVersion4 = new FormData();
+    fdlVersion4.top = new FormAttachment(0, margin);
+    fdlVersion4.left = new FormAttachment(0, 0);
+    fdlVersion4.right = new FormAttachment(middle, -margin);
+    wlVersion4.setLayoutData(fdlVersion4);
+    wVersion4 = new CheckBoxVar(variables, wProtocolComp, SWT.CHECK);
+    props.setLook(wVersion4);
+    FormData fdVersion4 = new FormData();
+    fdVersion4.top = new FormAttachment(wlVersion4, 0, SWT.CENTER);
+    fdVersion4.left = new FormAttachment(middle, 0);
+    fdVersion4.right = new FormAttachment(95, 0);
+    wVersion4.setLayoutData(fdVersion4);
+    Control lastControl = wVersion4;
+
+    // Browser port?
+    Label wlBrowserPort = new Label(wProtocolComp, SWT.RIGHT);
+    props.setLook(wlBrowserPort);
+    wlBrowserPort.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.BrowserPort.Label"));
+    FormData fdlBrowserPort = new FormData();
+    fdlBrowserPort.top = new FormAttachment(lastControl, margin);
+    fdlBrowserPort.left = new FormAttachment(0, 0); // First one in the left top corner
+    fdlBrowserPort.right = new FormAttachment(middle, -margin);
+    wlBrowserPort.setLayoutData(fdlBrowserPort);
+    wBrowserPort = new TextVar(variables, wProtocolComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wBrowserPort);
+    FormData fdBrowserPort = new FormData();
+    fdBrowserPort.top = new FormAttachment(wlBrowserPort, 0, SWT.CENTER);
+    fdBrowserPort.left = new FormAttachment(middle, 0); // To the right of the label
+    fdBrowserPort.right = new FormAttachment(95, 0);
+    wBrowserPort.setLayoutData(fdBrowserPort);
+    lastControl = wBrowserPort;
+
+    // Routing
+    wlRouting = new Label(wProtocolComp, SWT.RIGHT);
+    wlRouting.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Routing.Label"));
+    props.setLook(wlRouting);
+    FormData fdlRouting = new FormData();
+    fdlRouting.top = new FormAttachment(lastControl, margin);
+    fdlRouting.left = new FormAttachment(0, 0);
+    fdlRouting.right = new FormAttachment(middle, -margin);
+    wlRouting.setLayoutData(fdlRouting);
+    wRouting = new CheckBoxVar(variables, wProtocolComp, SWT.CHECK);
+    props.setLook(wRouting);
+    FormData fdRouting = new FormData();
+    fdRouting.top = new FormAttachment(wlRouting, 0, SWT.CENTER);
+    fdRouting.left = new FormAttachment(middle, 0);
+    fdRouting.right = new FormAttachment(95, 0);
+    wRouting.setLayoutData(fdRouting);
+    wRouting.addListener(SWT.Selection, e->enableFields());
+    lastControl = wRouting;
+
+    // Policy
+    wlPolicy = new Label(wProtocolComp, SWT.RIGHT);
+    wlPolicy.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Policy.Label"));
+    props.setLook(wlPolicy);
+    FormData fdlPolicy = new FormData();
+    fdlPolicy.top = new FormAttachment(lastControl, margin);
+    fdlPolicy.left = new FormAttachment(0, 0);
+    fdlPolicy.right = new FormAttachment(middle, -margin);
+    wlPolicy.setLayoutData(fdlPolicy);
+    wPolicy = new TextVar(variables, wProtocolComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wPolicy);
+    FormData fdPolicy = new FormData();
+    fdPolicy.top = new FormAttachment(wlPolicy, 0, SWT.CENTER);
+    fdPolicy.left = new FormAttachment(middle, 0);
+    fdPolicy.right = new FormAttachment(95, 0);
+    wPolicy.setLayoutData(fdPolicy);
+    lastControl = wPolicy;
 
     // Encryption?
-    wlEncryption = new Label(composite, SWT.RIGHT);
+    wlEncryption = new Label(wProtocolComp, SWT.RIGHT);
     wlEncryption.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.Encryption.Label"));
     props.setLook(wlEncryption);
     FormData fdlEncryption = new FormData();
@@ -283,24 +401,18 @@
     fdlEncryption.left = new FormAttachment(0, 0);
     fdlEncryption.right = new FormAttachment(middle, -margin);
     wlEncryption.setLayoutData(fdlEncryption);
-    wEncryption = new CheckBoxVar(variables, composite, SWT.CHECK);
+    wEncryption = new CheckBoxVar(variables, wProtocolComp, SWT.CHECK);
     props.setLook(wEncryption);
     FormData fdEncryption = new FormData();
     fdEncryption.top = new FormAttachment(wlEncryption, 0, SWT.CENTER);
     fdEncryption.left = new FormAttachment(middle, 0);
     fdEncryption.right = new FormAttachment(95, 0);
     wEncryption.setLayoutData(fdEncryption);
-    wEncryption.addSelectionListener(
-        new SelectionAdapter() {
-          @Override
-          public void widgetSelected(SelectionEvent e) {
-            enableFields();
-          }
-        });
+    wEncryption.addListener(SWT.Selection, e->enableFields());
     lastControl = wEncryption;
 
     // Trust Level?
-    wlTrustAllCertificates = new Label(composite, SWT.RIGHT);
+    wlTrustAllCertificates = new Label(wProtocolComp, SWT.RIGHT);
     wlTrustAllCertificates.setText(
         BaseMessages.getString(PKG, "NeoConnectionEditor.TrustAllCertificates.Label"));
     props.setLook(wlTrustAllCertificates);
@@ -309,175 +421,58 @@
     fdlTrustAllCertificates.left = new FormAttachment(0, 0);
     fdlTrustAllCertificates.right = new FormAttachment(middle, -margin);
     wlTrustAllCertificates.setLayoutData(fdlTrustAllCertificates);
-    wTrustAllCertificates = new CheckBoxVar(variables, composite, SWT.CHECK);
+    wTrustAllCertificates = new CheckBoxVar(variables, wProtocolComp, SWT.CHECK);
     props.setLook(wEncryption);
     FormData fdTrustAllCertificates = new FormData();
     fdTrustAllCertificates.top = new FormAttachment(wlTrustAllCertificates, 0, SWT.CENTER);
     fdTrustAllCertificates.left = new FormAttachment(middle, 0);
     fdTrustAllCertificates.right = new FormAttachment(95, 0);
     wTrustAllCertificates.setLayoutData(fdTrustAllCertificates);
-    lastControl = wlTrustAllCertificates;
-
-    gAdvanced = new Group(composite, SWT.SHADOW_ETCHED_IN);
-    props.setLook(gAdvanced);
-    FormLayout advancedLayout = new FormLayout();
-    advancedLayout.marginTop = margin;
-    advancedLayout.marginBottom = margin;
-    gAdvanced.setLayout(advancedLayout);
-    gAdvanced.setText("Advanced options");
-
-    // ConnectionLivenessCheckTimeout
-    Label wlConnectionLivenessCheckTimeout = new Label(gAdvanced, SWT.RIGHT);
-    wlConnectionLivenessCheckTimeout.setText(
-        BaseMessages.getString(PKG, "NeoConnectionEditor.ConnectionLivenessCheckTimeout.Label"));
-    props.setLook(wlConnectionLivenessCheckTimeout);
-    FormData fdlConnectionLivenessCheckTimeout = new FormData();
-    fdlConnectionLivenessCheckTimeout.top = new FormAttachment(0, 0);
-    fdlConnectionLivenessCheckTimeout.left = new FormAttachment(0, 0);
-    fdlConnectionLivenessCheckTimeout.right = new FormAttachment(middle, -margin);
-    wlConnectionLivenessCheckTimeout.setLayoutData(fdlConnectionLivenessCheckTimeout);
-    wConnectionLivenessCheckTimeout =
-        new TextVar(variables, gAdvanced, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wConnectionLivenessCheckTimeout);
-    FormData fdConnectionLivenessCheckTimeout = new FormData();
-    fdConnectionLivenessCheckTimeout.top =
-        new FormAttachment(wlConnectionLivenessCheckTimeout, 0, SWT.CENTER);
-    fdConnectionLivenessCheckTimeout.left = new FormAttachment(middle, 0);
-    fdConnectionLivenessCheckTimeout.right = new FormAttachment(95, 0);
-    wConnectionLivenessCheckTimeout.setLayoutData(fdConnectionLivenessCheckTimeout);
-    Control lastGroupControl = wConnectionLivenessCheckTimeout;
-
-    // MaxConnectionLifetime
-    Label wlMaxConnectionLifetime = new Label(gAdvanced, SWT.RIGHT);
-    wlMaxConnectionLifetime.setText(
-        BaseMessages.getString(PKG, "NeoConnectionEditor.MaxConnectionLifetime.Label"));
-    props.setLook(wlMaxConnectionLifetime);
-    FormData fdlMaxConnectionLifetime = new FormData();
-    fdlMaxConnectionLifetime.top = new FormAttachment(lastGroupControl, margin);
-    fdlMaxConnectionLifetime.left = new FormAttachment(0, 0);
-    fdlMaxConnectionLifetime.right = new FormAttachment(middle, -margin);
-    wlMaxConnectionLifetime.setLayoutData(fdlMaxConnectionLifetime);
-    wMaxConnectionLifetime = new TextVar(variables, gAdvanced, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wMaxConnectionLifetime);
-    FormData fdMaxConnectionLifetime = new FormData();
-    fdMaxConnectionLifetime.top = new FormAttachment(wlMaxConnectionLifetime, 0, SWT.CENTER);
-    fdMaxConnectionLifetime.left = new FormAttachment(middle, 0);
-    fdMaxConnectionLifetime.right = new FormAttachment(95, 0);
-    wMaxConnectionLifetime.setLayoutData(fdMaxConnectionLifetime);
-    lastGroupControl = wMaxConnectionLifetime;
-
-    // MaxConnectionPoolSize
-    Label wlMaxConnectionPoolSize = new Label(gAdvanced, SWT.RIGHT);
-    wlMaxConnectionPoolSize.setText(
-        BaseMessages.getString(PKG, "NeoConnectionEditor.MaxConnectionPoolSize.Label"));
-    props.setLook(wlMaxConnectionPoolSize);
-    FormData fdlMaxConnectionPoolSize = new FormData();
-    fdlMaxConnectionPoolSize.top = new FormAttachment(lastGroupControl, margin);
-    fdlMaxConnectionPoolSize.left = new FormAttachment(0, 0);
-    fdlMaxConnectionPoolSize.right = new FormAttachment(middle, -margin);
-    wlMaxConnectionPoolSize.setLayoutData(fdlMaxConnectionPoolSize);
-    wMaxConnectionPoolSize = new TextVar(variables, gAdvanced, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wMaxConnectionPoolSize);
-    FormData fdMaxConnectionPoolSize = new FormData();
-    fdMaxConnectionPoolSize.top = new FormAttachment(wlMaxConnectionPoolSize, 0, SWT.CENTER);
-    fdMaxConnectionPoolSize.left = new FormAttachment(middle, 0);
-    fdMaxConnectionPoolSize.right = new FormAttachment(95, 0);
-    wMaxConnectionPoolSize.setLayoutData(fdMaxConnectionPoolSize);
-    lastGroupControl = wMaxConnectionPoolSize;
-
-    // ConnectionAcquisitionTimeout
-    Label wlConnectionAcquisitionTimeout = new Label(gAdvanced, SWT.RIGHT);
-    wlConnectionAcquisitionTimeout.setText(
-        BaseMessages.getString(PKG, "NeoConnectionEditor.ConnectionAcquisitionTimeout.Label"));
-    props.setLook(wlConnectionAcquisitionTimeout);
-    FormData fdlConnectionAcquisitionTimeout = new FormData();
-    fdlConnectionAcquisitionTimeout.top = new FormAttachment(lastGroupControl, margin);
-    fdlConnectionAcquisitionTimeout.left = new FormAttachment(0, 0);
-    fdlConnectionAcquisitionTimeout.right = new FormAttachment(middle, -margin);
-    wlConnectionAcquisitionTimeout.setLayoutData(fdlConnectionAcquisitionTimeout);
-    wConnectionAcquisitionTimeout =
-        new TextVar(variables, gAdvanced, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wConnectionAcquisitionTimeout);
-    FormData fdConnectionAcquisitionTimeout = new FormData();
-    fdConnectionAcquisitionTimeout.top =
-        new FormAttachment(wlConnectionAcquisitionTimeout, 0, SWT.CENTER);
-    fdConnectionAcquisitionTimeout.left = new FormAttachment(middle, 0);
-    fdConnectionAcquisitionTimeout.right = new FormAttachment(95, 0);
-    wConnectionAcquisitionTimeout.setLayoutData(fdConnectionAcquisitionTimeout);
-    lastGroupControl = wConnectionAcquisitionTimeout;
-
-    // ConnectionTimeout
-    Label wlConnectionTimeout = new Label(gAdvanced, SWT.RIGHT);
-    wlConnectionTimeout.setText(
-        BaseMessages.getString(PKG, "NeoConnectionEditor.ConnectionTimeout.Label"));
-    props.setLook(wlConnectionTimeout);
-    FormData fdlConnectionTimeout = new FormData();
-    fdlConnectionTimeout.top = new FormAttachment(lastGroupControl, margin);
-    fdlConnectionTimeout.left = new FormAttachment(0, 0);
-    fdlConnectionTimeout.right = new FormAttachment(middle, -margin);
-    wlConnectionTimeout.setLayoutData(fdlConnectionTimeout);
-    wConnectionTimeout = new TextVar(variables, gAdvanced, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wConnectionTimeout);
-    FormData fdConnectionTimeout = new FormData();
-    fdConnectionTimeout.top = new FormAttachment(wlConnectionTimeout, 0, SWT.CENTER);
-    fdConnectionTimeout.left = new FormAttachment(middle, 0);
-    fdConnectionTimeout.right = new FormAttachment(95, 0);
-    wConnectionTimeout.setLayoutData(fdConnectionTimeout);
-    lastGroupControl = wConnectionTimeout;
-
-    // MaxTransactionRetryTime
-    Label wlMaxTransactionRetryTime = new Label(gAdvanced, SWT.RIGHT);
-    wlMaxTransactionRetryTime.setText(
-        BaseMessages.getString(PKG, "NeoConnectionEditor.MaxTransactionRetryTime.Label"));
-    props.setLook(wlMaxTransactionRetryTime);
-    FormData fdlMaxTransactionRetryTime = new FormData();
-    fdlMaxTransactionRetryTime.top = new FormAttachment(lastGroupControl, margin);
-    fdlMaxTransactionRetryTime.left = new FormAttachment(0, 0);
-    fdlMaxTransactionRetryTime.right = new FormAttachment(middle, -margin);
-    wlMaxTransactionRetryTime.setLayoutData(fdlMaxTransactionRetryTime);
-    wMaxTransactionRetryTime =
-        new TextVar(variables, gAdvanced, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
-    props.setLook(wMaxTransactionRetryTime);
-    FormData fdMaxTransactionRetryTime = new FormData();
-    fdMaxTransactionRetryTime.top = new FormAttachment(wlMaxTransactionRetryTime, 0, SWT.CENTER);
-    fdMaxTransactionRetryTime.left = new FormAttachment(middle, 0);
-    fdMaxTransactionRetryTime.right = new FormAttachment(95, 0);
-    wMaxTransactionRetryTime.setLayoutData(fdMaxTransactionRetryTime);
-    lastGroupControl = wMaxTransactionRetryTime;
-
-    // End of Advanced group
+    
+    // End of the basic tab...
     //
-    FormData fdgAdvanced = new FormData();
-    fdgAdvanced.left = new FormAttachment(0, 0);
-    fdgAdvanced.right = new FormAttachment(100, 0);
-    fdgAdvanced.top = new FormAttachment(lastControl, margin * 2);
-    gAdvanced.setLayoutData(fdgAdvanced);
-    lastControl = gAdvanced;
+    wProtocolComp.pack();
 
-    // The URLs group...
-    //
-    Group gUrls = new Group(composite, SWT.SHADOW_ETCHED_IN);
-    props.setLook(gUrls);
-    FormLayout urlsLayout = new FormLayout();
-    urlsLayout.marginTop = margin;
-    urlsLayout.marginBottom = margin;
-    gUrls.setLayout(urlsLayout);
-    gUrls.setText(BaseMessages.getString(PKG, "NeoConnectionEditor.URLs.Label"));
+    Rectangle bounds = wProtocolComp.getBounds();
+
+    wProtocolSComp.setContent(wProtocolComp);
+    wProtocolSComp.setExpandHorizontal(true);
+    wProtocolSComp.setExpandVertical(true);
+    wProtocolSComp.setMinWidth(bounds.width);
+    wProtocolSComp.setMinHeight(bounds.height);
+
+    wProtocolTab.setControl(wProtocolSComp);
+  }
+
+  private void addUrlsTab(PropsUi props, IVariables variables) {
+    CTabItem wUrlsTab = new CTabItem(wTabFolder, SWT.NONE);
+    wUrlsTab.setText("Manual URLs");
+    ScrolledComposite wUrlsSComp =
+            new ScrolledComposite(wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
+    wUrlsSComp.setLayout(new FillLayout());
+
+    Composite wUrlsComp = new Composite(wUrlsSComp, SWT.NONE);
+    props.setLook(wUrlsComp);
+
+    FormLayout formLayout = new FormLayout();
+    formLayout.marginWidth = 3;
+    formLayout.marginHeight = 3;
+    wUrlsComp.setLayout(formLayout);
 
     // URLs
     wUrls =
-        new TableView(
-            variables,
-            gUrls,
-            SWT.NONE,
-            new ColumnInfo[] {
-              new ColumnInfo(
-                  BaseMessages.getString(PKG, "NeoConnectionEditor.URLColumn.Label"),
-                  ColumnInfo.COLUMN_TYPE_TEXT)
-            },
-            getMetadata().getManualUrls().size(),
-            e -> setChanged(),
-            props);
+            new TableView(
+                    variables,
+                    wUrlsComp,
+                    SWT.NONE,
+                    new ColumnInfo[] {
+                            new ColumnInfo(
+                                    BaseMessages.getString(PKG, "NeoConnectionEditor.URLColumn.Label"),
+                                    ColumnInfo.COLUMN_TYPE_TEXT)
+                    },
+                    getMetadata().getManualUrls().size(),
+                    e -> setChanged(),
+                    props);
     wUrls.table.addListener(SWT.Selection, e -> enableFields());
     wUrls.table.addListener(SWT.MouseDown, e -> enableFields());
     wUrls.table.addListener(SWT.MouseUp, e -> enableFields());
@@ -491,81 +486,232 @@
     fdUrls.right = new FormAttachment(100, 0);
     fdUrls.bottom = new FormAttachment(100, 0);
     wUrls.setLayoutData(fdUrls);
-
-    // End of Advanced group
+    
+    // End of the basic tab...
     //
-    FormData fdgUrls = new FormData();
-    fdgUrls.left = new FormAttachment(0, 0);
-    fdgUrls.right = new FormAttachment(100, 0);
-    fdgUrls.top = new FormAttachment(lastControl, margin * 2);
-    fdgUrls.bottom = new FormAttachment(100, -margin * 2);
-    gUrls.setLayoutData(fdgUrls);
+    wUrlsComp.pack();
 
-    setWidgetsContent();
+    Rectangle bounds = wUrlsComp.getBounds();
 
-    // Add modify listeners to all controls.
-    // This will inform the Metadata perspective in the Hop GUI that this object was modified and
-    // needs to be saved.
+    wUrlsSComp.setContent(wUrlsComp);
+    wUrlsSComp.setExpandHorizontal(true);
+    wUrlsSComp.setExpandVertical(true);
+    wUrlsSComp.setMinWidth(bounds.width);
+    wUrlsSComp.setMinHeight(bounds.height);
+
+    wUrlsTab.setControl(wUrlsSComp);
+  }
+  
+  private void addAdvancedTab(PropsUi props, IVariables variables, int middle, int margin) {
+    CTabItem wAdvancedTab = new CTabItem(wTabFolder, SWT.NONE);
+    wAdvancedTab.setText("Advanced  ");
+    ScrolledComposite wAdvancedSComp =
+            new ScrolledComposite(wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
+    wAdvancedSComp.setLayout(new FillLayout());
+
+    Composite wAdvancedComp = new Composite(wAdvancedSComp, SWT.NONE);
+    props.setLook(wAdvancedComp);
+
+    FormLayout formLayout = new FormLayout();
+    formLayout.marginWidth = 3;
+    formLayout.marginHeight = 3;
+    wAdvancedComp.setLayout(formLayout);
+    
+    // ConnectionLivenessCheckTimeout
+    Label wlConnectionLivenessCheckTimeout = new Label(wAdvancedComp, SWT.RIGHT);
+    wlConnectionLivenessCheckTimeout.setText(
+            BaseMessages.getString(PKG, "NeoConnectionEditor.ConnectionLivenessCheckTimeout.Label"));
+    props.setLook(wlConnectionLivenessCheckTimeout);
+    FormData fdlConnectionLivenessCheckTimeout = new FormData();
+    fdlConnectionLivenessCheckTimeout.top = new FormAttachment(0, 0);
+    fdlConnectionLivenessCheckTimeout.left = new FormAttachment(0, 0);
+    fdlConnectionLivenessCheckTimeout.right = new FormAttachment(middle, -margin);
+    wlConnectionLivenessCheckTimeout.setLayoutData(fdlConnectionLivenessCheckTimeout);
+    wConnectionLivenessCheckTimeout =
+            new TextVar(variables, wAdvancedComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wConnectionLivenessCheckTimeout);
+    FormData fdConnectionLivenessCheckTimeout = new FormData();
+    fdConnectionLivenessCheckTimeout.top =
+            new FormAttachment(wlConnectionLivenessCheckTimeout, 0, SWT.CENTER);
+    fdConnectionLivenessCheckTimeout.left = new FormAttachment(middle, 0);
+    fdConnectionLivenessCheckTimeout.right = new FormAttachment(95, 0);
+    wConnectionLivenessCheckTimeout.setLayoutData(fdConnectionLivenessCheckTimeout);
+    Control lastGroupControl = wConnectionLivenessCheckTimeout;
+
+    // MaxConnectionLifetime
+    Label wlMaxConnectionLifetime = new Label(wAdvancedComp, SWT.RIGHT);
+    wlMaxConnectionLifetime.setText(
+            BaseMessages.getString(PKG, "NeoConnectionEditor.MaxConnectionLifetime.Label"));
+    props.setLook(wlMaxConnectionLifetime);
+    FormData fdlMaxConnectionLifetime = new FormData();
+    fdlMaxConnectionLifetime.top = new FormAttachment(lastGroupControl, margin);
+    fdlMaxConnectionLifetime.left = new FormAttachment(0, 0);
+    fdlMaxConnectionLifetime.right = new FormAttachment(middle, -margin);
+    wlMaxConnectionLifetime.setLayoutData(fdlMaxConnectionLifetime);
+    wMaxConnectionLifetime = new TextVar(variables, wAdvancedComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wMaxConnectionLifetime);
+    FormData fdMaxConnectionLifetime = new FormData();
+    fdMaxConnectionLifetime.top = new FormAttachment(wlMaxConnectionLifetime, 0, SWT.CENTER);
+    fdMaxConnectionLifetime.left = new FormAttachment(middle, 0);
+    fdMaxConnectionLifetime.right = new FormAttachment(95, 0);
+    wMaxConnectionLifetime.setLayoutData(fdMaxConnectionLifetime);
+    lastGroupControl = wMaxConnectionLifetime;
+
+    // MaxConnectionPoolSize
+    Label wlMaxConnectionPoolSize = new Label(wAdvancedComp, SWT.RIGHT);
+    wlMaxConnectionPoolSize.setText(
+            BaseMessages.getString(PKG, "NeoConnectionEditor.MaxConnectionPoolSize.Label"));
+    props.setLook(wlMaxConnectionPoolSize);
+    FormData fdlMaxConnectionPoolSize = new FormData();
+    fdlMaxConnectionPoolSize.top = new FormAttachment(lastGroupControl, margin);
+    fdlMaxConnectionPoolSize.left = new FormAttachment(0, 0);
+    fdlMaxConnectionPoolSize.right = new FormAttachment(middle, -margin);
+    wlMaxConnectionPoolSize.setLayoutData(fdlMaxConnectionPoolSize);
+    wMaxConnectionPoolSize = new TextVar(variables, wAdvancedComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wMaxConnectionPoolSize);
+    FormData fdMaxConnectionPoolSize = new FormData();
+    fdMaxConnectionPoolSize.top = new FormAttachment(wlMaxConnectionPoolSize, 0, SWT.CENTER);
+    fdMaxConnectionPoolSize.left = new FormAttachment(middle, 0);
+    fdMaxConnectionPoolSize.right = new FormAttachment(95, 0);
+    wMaxConnectionPoolSize.setLayoutData(fdMaxConnectionPoolSize);
+    lastGroupControl = wMaxConnectionPoolSize;
+
+    // ConnectionAcquisitionTimeout
+    Label wlConnectionAcquisitionTimeout = new Label(wAdvancedComp, SWT.RIGHT);
+    wlConnectionAcquisitionTimeout.setText(
+            BaseMessages.getString(PKG, "NeoConnectionEditor.ConnectionAcquisitionTimeout.Label"));
+    props.setLook(wlConnectionAcquisitionTimeout);
+    FormData fdlConnectionAcquisitionTimeout = new FormData();
+    fdlConnectionAcquisitionTimeout.top = new FormAttachment(lastGroupControl, margin);
+    fdlConnectionAcquisitionTimeout.left = new FormAttachment(0, 0);
+    fdlConnectionAcquisitionTimeout.right = new FormAttachment(middle, -margin);
+    wlConnectionAcquisitionTimeout.setLayoutData(fdlConnectionAcquisitionTimeout);
+    wConnectionAcquisitionTimeout =
+            new TextVar(variables, wAdvancedComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wConnectionAcquisitionTimeout);
+    FormData fdConnectionAcquisitionTimeout = new FormData();
+    fdConnectionAcquisitionTimeout.top =
+            new FormAttachment(wlConnectionAcquisitionTimeout, 0, SWT.CENTER);
+    fdConnectionAcquisitionTimeout.left = new FormAttachment(middle, 0);
+    fdConnectionAcquisitionTimeout.right = new FormAttachment(95, 0);
+    wConnectionAcquisitionTimeout.setLayoutData(fdConnectionAcquisitionTimeout);
+    lastGroupControl = wConnectionAcquisitionTimeout;
+
+    // ConnectionTimeout
+    Label wlConnectionTimeout = new Label(wAdvancedComp, SWT.RIGHT);
+    wlConnectionTimeout.setText(
+            BaseMessages.getString(PKG, "NeoConnectionEditor.ConnectionTimeout.Label"));
+    props.setLook(wlConnectionTimeout);
+    FormData fdlConnectionTimeout = new FormData();
+    fdlConnectionTimeout.top = new FormAttachment(lastGroupControl, margin);
+    fdlConnectionTimeout.left = new FormAttachment(0, 0);
+    fdlConnectionTimeout.right = new FormAttachment(middle, -margin);
+    wlConnectionTimeout.setLayoutData(fdlConnectionTimeout);
+    wConnectionTimeout = new TextVar(variables, wAdvancedComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wConnectionTimeout);
+    FormData fdConnectionTimeout = new FormData();
+    fdConnectionTimeout.top = new FormAttachment(wlConnectionTimeout, 0, SWT.CENTER);
+    fdConnectionTimeout.left = new FormAttachment(middle, 0);
+    fdConnectionTimeout.right = new FormAttachment(95, 0);
+    wConnectionTimeout.setLayoutData(fdConnectionTimeout);
+    lastGroupControl = wConnectionTimeout;
+
+    // MaxTransactionRetryTime
+    Label wlMaxTransactionRetryTime = new Label(wAdvancedComp, SWT.RIGHT);
+    wlMaxTransactionRetryTime.setText(
+            BaseMessages.getString(PKG, "NeoConnectionEditor.MaxTransactionRetryTime.Label"));
+    props.setLook(wlMaxTransactionRetryTime);
+    FormData fdlMaxTransactionRetryTime = new FormData();
+    fdlMaxTransactionRetryTime.top = new FormAttachment(lastGroupControl, margin);
+    fdlMaxTransactionRetryTime.left = new FormAttachment(0, 0);
+    fdlMaxTransactionRetryTime.right = new FormAttachment(middle, -margin);
+    wlMaxTransactionRetryTime.setLayoutData(fdlMaxTransactionRetryTime);
+    wMaxTransactionRetryTime =
+            new TextVar(variables, wAdvancedComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+    props.setLook(wMaxTransactionRetryTime);
+    FormData fdMaxTransactionRetryTime = new FormData();
+    fdMaxTransactionRetryTime.top = new FormAttachment(wlMaxTransactionRetryTime, 0, SWT.CENTER);
+    fdMaxTransactionRetryTime.left = new FormAttachment(middle, 0);
+    fdMaxTransactionRetryTime.right = new FormAttachment(95, 0);
+    wMaxTransactionRetryTime.setLayoutData(fdMaxTransactionRetryTime);
+    
+    // End of the basic tab...
     //
-    Listener modifyListener = e -> setChanged();
-    wName.addListener(SWT.Modify, modifyListener);
-    wServer.addListener(SWT.Modify, modifyListener);
-    wDatabaseName.addListener(SWT.Modify, modifyListener);
-    wVersion4.addListener(SWT.Selection, modifyListener);
-    wBoltPort.addListener(SWT.Selection, modifyListener);
-    wBrowserPort.addListener(SWT.Modify, modifyListener);
-    wPolicy.addListener(SWT.Modify, modifyListener);
-    wUsername.addListener(SWT.Modify, modifyListener);
-    wPassword.addListener(SWT.Modify, modifyListener);
-    wRouting.addListener(SWT.Selection, modifyListener);
-    wEncryption.addListener(SWT.Selection, modifyListener);
-    wTrustAllCertificates.addListener(SWT.Selection, modifyListener);
-    wConnectionLivenessCheckTimeout.addListener(SWT.Modify, modifyListener);
-    wMaxConnectionLifetime.addListener(SWT.Modify, modifyListener);
-    wMaxConnectionPoolSize.addListener(SWT.Modify, modifyListener);
-    wConnectionAcquisitionTimeout.addListener(SWT.Modify, modifyListener);
-    wConnectionTimeout.addListener(SWT.Modify, modifyListener);
-    wMaxTransactionRetryTime.addListener(SWT.Modify, modifyListener);
+    wAdvancedComp.pack();
+
+    Rectangle bounds = wAdvancedComp.getBounds();
+
+    wAdvancedSComp.setContent(wAdvancedComp);
+    wAdvancedSComp.setExpandHorizontal(true);
+    wAdvancedSComp.setExpandVertical(true);
+    wAdvancedSComp.setMinWidth(bounds.width);
+    wAdvancedSComp.setMinHeight(bounds.height);
+
+    wAdvancedTab.setControl(wAdvancedSComp);
   }
 
   private void enableFields() {
-    wlPolicy.setEnabled(wRouting.getSelection());
-    wPolicy.setEnabled(wRouting.getSelection());
 
+    // If you specify URLs manually a lot of things are no longer available...
+    //
     boolean hasNoUrls = wUrls.nrNonEmpty() == 0;
     for (Control control :
         new Control[] {
+          wlAutomatic,
+          wAutomatic,
           wlServer,
           wServer,
           wlDatabaseName,
           wDatabaseName,
-          wlBoltPort,
-          wBoltPort,
+          wlDatabasePort,
+          wDatabasePort,
           wlRouting,
           wRouting,
           wlPolicy,
           wPolicy,
           wlEncryption,
           wEncryption,
-          gAdvanced
         }) {
       control.setEnabled(hasNoUrls);
     }
 
-    boolean encryption = wEncryption.getSelection();
-    wlTrustAllCertificates.setEnabled(encryption);
-    wTrustAllCertificates.setEnabled(encryption);
-    wTrustAllCertificates.getTextVar().setEnabled(encryption);
+    // For the normal scenarios without manual URLs we consider the automatic flag.
+    // If things are configured automatically a number of flags are no longer applicable:
+    // Version 4, routing, routing policy, encryption & trust all certificates.
+    //
+    NeoConnection neo = new NeoConnection();
+    getWidgetsContent(neo);
+
+    boolean automatic = neo.isAutomatic();
+    boolean routing = neo.isRouting();
+    boolean encryption = neo.isUsingEncryption();
+
+    wlVersion4.setEnabled(!automatic);
+    wVersion4.setEnabled(!automatic);
+    wRouting.setEnabled(!automatic);
+    wlRouting.setEnabled(!automatic);
+    wRouting.setEnabled(!automatic);
+    wlEncryption.setEnabled(!automatic);
+    wEncryption.setEnabled(!automatic);
+
+    wlPolicy.setEnabled(!automatic && routing);
+    wPolicy.setEnabled(!automatic && routing);
+
+    wlTrustAllCertificates.setEnabled(!automatic && encryption);
+    wTrustAllCertificates.setEnabled(!automatic && encryption);
+    wTrustAllCertificates.getTextVar().setEnabled(!automatic && encryption);
   }
 
   @Override
   public void setWidgetsContent() {
     wName.setText(Const.NVL(metadata.getName(), ""));
+    wAutomatic.setSelection(metadata.isAutomatic());
+    wAutomatic.setVariableName(Const.NVL(metadata.getAutomaticVariable(), ""));
     wServer.setText(Const.NVL(metadata.getServer(), ""));
     wDatabaseName.setText(Const.NVL(metadata.getDatabaseName(), ""));
     wVersion4.setSelection(metadata.isVersion4());
     wVersion4.setVariableName(Const.NVL(metadata.getVersion4Variable(), ""));
-    wBoltPort.setText(Const.NVL(metadata.getBoltPort(), ""));
+    wDatabasePort.setText(Const.NVL(metadata.getBoltPort(), ""));
     wBrowserPort.setText(Const.NVL(metadata.getBrowserPort(), ""));
     wRouting.setSelection(metadata.isRouting());
     wRouting.setVariableName(Const.NVL(metadata.getRoutingVariable(), ""));
@@ -599,11 +745,13 @@
   @Override
   public void getWidgetsContent(NeoConnection neoConnection) {
     neoConnection.setName(wName.getText());
+    neoConnection.setAutomatic(wAutomatic.getSelection());
+    neoConnection.setAutomaticVariable(wAutomatic.getVariableName());
     neoConnection.setServer(wServer.getText());
     neoConnection.setDatabaseName(wDatabaseName.getText());
     neoConnection.setVersion4(wVersion4.getSelection());
     neoConnection.setVersion4Variable(wVersion4.getVariableName());
-    neoConnection.setBoltPort(wBoltPort.getText());
+    neoConnection.setBoltPort(wDatabasePort.getText());
     neoConnection.setBrowserPort(wBrowserPort.getText());
     neoConnection.setRouting(wRouting.getSelection());
     neoConnection.setRoutingVariable(wRouting.getVariableName());
@@ -671,9 +819,12 @@
 
   @Override
   public void setChanged() {
-    if (this.isChanged == false) {
-      this.isChanged = true;
-      MetadataPerspective.getInstance().updateEditor(this);
-    }
+    this.isChanged = true;
+    MetadataPerspective.getInstance().updateEditor(this);
+  }
+
+  public void clearChanged() {
+    this.isChanged = false;
+    MetadataPerspective.getInstance().updateEditor(this);
   }
 }
diff --git a/plugins/tech/neo4j/src/main/resources/org/apache/hop/neo4j/shared/messages/messages_en_US.properties b/plugins/tech/neo4j/src/main/resources/org/apache/hop/neo4j/shared/messages/messages_en_US.properties
index aa0803a..1e733a7 100644
--- a/plugins/tech/neo4j/src/main/resources/org/apache/hop/neo4j/shared/messages/messages_en_US.properties
+++ b/plugins/tech/neo4j/src/main/resources/org/apache/hop/neo4j/shared/messages/messages_en_US.properties
@@ -16,10 +16,12 @@
 #
 #
 NeoConnectionEditor.Name.Label=Connection name
+NeoConnectionEditor.Automatic.Label=Automatic?
+NeoConnectionEditor.Automatic.Tooltip=Asks the driver to automatically determine protocol options like encryption and routing.
 NeoConnectionEditor.Server.Label=Server or IP address
-NeoConnectionEditor.DatabaseName.Label=Database name (4.0)
+NeoConnectionEditor.DatabaseName.Label=Database name
 NeoConnectionEditor.Version4.Label=Version 4 database?
-NeoConnectionEditor.BoltPort.Label=Bolt Port
+NeoConnectionEditor.DatabasePort.Label=Database port
 NeoConnectionEditor.BrowserPort.Label=Browser Port
 NeoConnectionEditor.Routing.Label=Use routing, neo4j:// protocol?
 NeoConnectionEditor.Policy.Label=Routing Policy