package com.intellij.remote;

import com.intellij.openapi.diagnostic.Logger;

/**
 * This class denotes the type of the source to obtain remote credentials. 
 * 
 * @author traff
 */
public enum RemoteConnectionType {
  /**
   * Currently selected SDK (e.g. <Project default>) 
   */
  DEFAULT_SDK,
  /**
   * Web deployment server  
   */
  DEPLOYMENT_SERVER,
  /**
   * Remote SDK
   */
  REMOTE_SDK,
  /**
   * Current project vagrant
   */
  CURRENT_VAGRANT,
  /**
   * No source is predefined - it would be asked on request 
   */
  NONE;

  private static final Logger LOG = Logger.getInstance(RemoteConnectionType.class);

  public static RemoteConnectionType findByName(String name) {
    try {
      return valueOf(name);
    }
    catch (Exception e) {
      LOG.error("Cant find RemoteConnectionType with the name " + name, e);
      return NONE;
    }
  }
}

@@ -69,16 +69,101 @@
 .Logger;
+%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.jetbrains.annotations.Nullable;
 %0A%0A/**%0A *
@@ -708,16 +708,27 @@
 lass);%0A%0A
+  @NotNull%0A
   public
@@ -767,16 +767,26 @@
 dByName(
+@Nullable 
 String n
@@ -788,24 +788,73 @@
 ing name) %7B%0A
+    if (name == null) %7B%0A      return NONE;%0A    %7D%0A
     try %7B%0A  

Return NONE connection type for null.