private static void setConnectButtonDefaults_common()

in java/com/google/cloud/deploymentmanager/autogen/SpecDefaults.java [150:167]


  private static void setConnectButtonDefaults_common(PostDeployInfo.Builder postDeploy) {
    ConnectToInstanceSpec.Builder button = postDeploy.getConnectButtonBuilder();

    if (Strings.isNullOrEmpty(button.getDisplayLabel())
        && Strings.isNullOrEmpty(postDeploy.getConnectButtonLabel())) {
      // Ideally we should allow empty button label, in which case the widget should automatically
      // determine the right label (SSH for Linux, RDP for Windows). We need to change the UI and
      // config validation in order to support this. Once that happens, this default can be dropped.
      button.setDisplayLabel(DEFAULT_CONNECT_BUTTON_LABEL);
    }

    // TODO(khajduczenia) The following copy action should be removed as soon as FE is migrated.
    // Support for deprecated connect_button_label field in PostDeployInfo:
    if (Strings.isNullOrEmpty(button.getDisplayLabel())
        && !Strings.isNullOrEmpty(postDeploy.getConnectButtonLabel())) {
      button.setDisplayLabel(postDeploy.getConnectButtonLabel());
    }
  }