private void setTitle(VpnProfile profile) {
   String formatString =
       mAddingProfile
           ? getString(R.string.vpn_edit_title_add)
           : getString(R.string.vpn_edit_title_edit);
   setTitle(String.format(formatString, profile.getType().getDisplayName()));
 }
  private VpnProfileEditor getEditor(VpnProfile p) {
    switch (p.getType()) {
      case L2TP_IPSEC:
        return new L2tpIpsecEditor((L2tpIpsecProfile) p);

      case L2TP_IPSEC_PSK:
        return new L2tpIpsecPskEditor((L2tpIpsecPskProfile) p);

      case L2TP:
        return new L2tpEditor((L2tpProfile) p);

      case OPENVPN:
        return new OpenvpnEditor((OpenvpnProfile) p);

      case PPTP:
        return new PptpEditor((PptpProfile) p);

      default:
        return new VpnProfileEditor(p);
    }
  }