Program: 125473
Project: 125473
Buggy source:
/** 
 * SetEditable fields.
 * @param boolean
 */
@SuppressWarnings("String_Node_Str") private void setPropertiesFormEditable(boolean visible){
  clearContextParams();
  EDBParamName sidOrDatabase=null;
  if (EDatabaseTypeName.ORACLEFORSID.getProduct().equals(getConnection().getProductId())) {
    if (EDatabaseConnTemplate.ORACLESN.getDBDisplayName().equals(getConnection().getDatabaseType())) {
      sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
      sidOrDatabaseText.setLabelWidth(65);
      sidOrDatabase=EDBParamName.ServiceName;
    }
 else     if (EDatabaseConnTemplate.ORACLEFORSID.getDBDisplayName().equals(getConnection().getDatabaseType())) {
      sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
      sidOrDatabase=EDBParamName.Sid;
    }
 else     if (EDatabaseConnTemplate.ORACLE_OCI.getDBDisplayName().equals(getConnection().getDatabaseType())) {
      sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
      sidOrDatabase=EDBParamName.Sid;
    }
  }
 else {
    sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
    sidOrDatabase=EDBParamName.Database;
    if (EDatabaseConnTemplate.INFORMIX.getDBDisplayName().equals(getConnection().getDatabaseType())) {
      sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
    }
  }
  if (EDatabaseTypeName.MSODBC.getDisplayName().equals(dbTypeCombo.getText())) {
    sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
  }
  if (EDatabaseTypeName.GODBC.getDisplayName().equals(dbTypeCombo.getText())) {
    sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
  }
  if (EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {
    addContextParams(EDBParamName.JdbcUrl,visible);
    addContextParams(EDBParamName.DriverJar,visible);
    addContextParams(EDBParamName.MappingFile,visible);
    addContextParams(EDBParamName.ClassName,visible);
  }
  addContextParams(EDBParamName.Login,visible);
  addContextParams(EDBParamName.Password,visible);
  boolean isOracle=visible && oracleVersionEnable();
  boolean isAS400=visible && as400VersionEnable();
  boolean isMySQL=visible && asMySQLVersionEnable();
  boolean isVertica=visible && asVerticaVersionEnable();
  boolean isSAS=visible && asSASVersionEnable();
  boolean isHbase=visible && asHbaseVersionEnable();
  boolean isMaprdb=visible && asMaprdbVersionEnable();
  boolean isImpala=visible && ImpalaVersionEnable();
  boolean isMsSQL=visible && asMsSQLVersionEnable();
  dbVersionCombo.setEnabled(!isReadOnly() && (isOracle || isAS400 || isMySQL|| isVertica|| isSAS|| isImpala|| isMsSQL|| EDatabaseConnTemplate.PSQL.getDBTypeName().equals(dbTypeCombo.getText())|| EDatabaseConnTemplate.PLUSPSQL.getDBTypeName().equals(dbTypeCombo.getText())|| EDatabaseConnTemplate.ACCESS.getDBTypeName().equals(dbTypeCombo.getText())|| EDatabaseConnTemplate.MSSQL05_08.getDBDisplayName().equals(dbTypeCombo.getText())));
  usernameText.setEditable(visible);
  passwordText.setEditable(visible);
  serverText.setEditable(false);
  portText.setEditable(false);
  sidOrDatabaseText.setEditable(false);
  datasourceText.setEditable(false);
  additionParamText.setEditable(false);
  schemaText.setEditable(false);
  fileField.setEditable(false);
  directoryField.setEditable(false);
  mappingFileText.setEditable(false);
  mappingSelectButton.setEnabled(false);
  if (EDatabaseConnTemplate.GODBC.getDBTypeName().equals(dbTypeCombo.getText()) || EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {
    addContextParams(EDBParamName.MappingFile,true);
    mappingFileText.show();
    mappingFileText.setEditable(true);
    mappingSelectButton.setVisible(true);
    mappingSelectButton.setEnabled(true);
  }
 else {
    addContextParams(EDBParamName.MappingFile,false);
    mappingFileText.hide();
    mappingFileText.setEditable(false);
    mappingSelectButton.setVisible(false);
    mappingSelectButton.setEnabled(false);
  }
  if (dbTypeCombo.getSelectionIndex() < 0) {
    urlConnectionStringText.setEditable(false);
  }
 else {
    EDatabaseConnTemplate template=EDatabaseConnTemplate.indexOfTemplate(dbTypeCombo.getText());
    String s="String_Node_Str";
    if (template != null) {
      EDatabaseVersion4Drivers version=null;
      if (isHiveDBConnSelected()) {
        boolean isEmbeddedMode=isHiveEmbeddedMode();
        if (doSupportHive2()) {
          if (isEmbeddedMode) {
            s=template.getUrlTemplate(EDatabaseVersion4Drivers.HIVE_2_EMBEDDED);
          }
 else {
            s=template.getUrlTemplate(EDatabaseVersion4Drivers.HIVE_2_STANDALONE);
          }
        }
 else {
          if (isEmbeddedMode) {
            s=template.getUrlTemplate(EDatabaseVersion4Drivers.HIVE_EMBEDDED);
          }
 else {
            s=template.getUrlTemplate(EDatabaseVersion4Drivers.HIVE);
          }
        }
      }
 else {
        version=EDatabaseVersion4Drivers.indexOfByVersionDisplay(dbVersionCombo.getText());
        s=template.getUrlTemplate(version);
      }
    }
    if (isHbase || isMaprdb || isDBTypeSelected(EDatabaseConnTemplate.ORACLE_CUSTOM)|| isDBTypeSelected(EDatabaseConnTemplate.IMPALA)) {
      urlConnectionStringText.hide();
    }
 else {
      urlConnectionStringText.show();
    }
    if (isDBTypeSelected(EDatabaseConnTemplate.ORACLE_CUSTOM)) {
      serverText.setLabelText(Messages.getString("String_Node_Str"));
    }
 else {
      serverText.setLabelText(Messages.getString("String_Node_Str"));
    }
    hideHCLinkSettings(!isHbase && !isMaprdb && !isHiveDBConnSelected());
    hideHBaseSettings(!isHbase);
    hideMaprdbSettings(!isMaprdb);
    hideImpalaSettings(!isImpala);
    updateHadoopPropertiesFieldsState();
    updateHiveJDBCPropertiesFieldsState();
    showIfAdditionalJDBCSettings();
    showIfSupportEncryption();
    showIfAuthentication();
    hideHiveExecutionFields(!doSupportTez());
    urlConnectionStringText.setEditable(!visible);
    boolean schemaTextIsShow=true;
    if (template == EDatabaseConnTemplate.MSSQL) {
      schemaText.show();
      schemaText.setEditable(true);
      addContextParams(EDBParamName.Schema,true);
    }
 else     if (template == EDatabaseConnTemplate.VERTICA || template == EDatabaseConnTemplate.INFORMIX) {
      schemaText.show();
      schemaText.setEditable(true);
      addContextParams(EDBParamName.Schema,true);
    }
 else     if (template == EDatabaseConnTemplate.GENERAL_JDBC) {
      String jdbcUrlString="String_Node_Str";
      if (isContextMode()) {
        if (selectedContextType == null) {
          selectedContextType=ConnectionContextHelper.getContextTypeForContextMode(getShell(),getConnection(),true);
        }
        if (selectedContextType != null) {
          jdbcUrlString=ConnectionContextHelper.getOriginalValue(selectedContextType,getConnection().getURL());
        }
      }
 else {
        jdbcUrlString=generalJdbcUrlText.getText();
      }
      if (jdbcUrlString.contains("String_Node_Str")) {
        jDBCschemaText.setHideWidgets(false);
        addContextParams(EDBParamName.Schema,true);
      }
 else {
        jDBCschemaText.setHideWidgets(true);
        addContextParams(EDBParamName.Schema,false);
      }
    }
 else {
      schemaTextIsShow=false;
    }
    if (s.contains(EDatabaseConnVar.HOST.getVariable()) || isHbase || isMaprdb|| isImpala) {
      if (!EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {
        serverText.show();
        serverText.setEditable(visible);
        if (isHbase) {
          String serverName=getConnection().getServerName();
          if (serverName == null || "String_Node_Str".equals(serverName)) {
            serverText.setText(EDatabaseConnTemplate.HBASE.getUrlTemplate(EDatabaseVersion4Drivers.HBASE));
          }
        }
        if (isMaprdb) {
          String serverName=getConnection().getServerName();
          if (serverName == null || "String_Node_Str".equals(serverName)) {
            serverText.setText(EDatabaseConnTemplate.MAPRDB.getUrlTemplate(EDatabaseVersion4Drivers.MAPRDB));
          }
        }
        if (isImpala) {
          String serverName=getConnection().getServerName();
          if (serverName == null || "String_Node_Str".equals(serverName)) {
            serverText.setText("String_Node_Str");
          }
        }
        addContextParams(EDBParamName.Server,visible);
      }
    }
 else {
      if (isHiveDBConnSelected()) {
        if (isHiveEmbeddedMode()) {
          portText.show();
          serverText.show();
          portText.setEditable(true);
          serverText.setEditable(true);
          hideMappingFileRelatedWidgets(true);
        }
 else {
          portText.show();
          serverText.show();
          portText.setEditable(true);
          serverText.setEditable(visible);
          hideMappingFileRelatedWidgets(true);
        }
        sidOrDatabaseText.setEditable(true);
      }
 else {
        serverText.hide();
      }
      addContextParams(EDBParamName.Server,false);
    }
    if (s.contains(EDatabaseConnVar.PORT.getVariable()) || isHbase || isMaprdb|| isImpala) {
      portText.show();
      portText.setEditable(visible);
      addContextParams(EDBParamName.Port,visible);
    }
 else {
      if (isHiveDBConnSelected()) {
        portText.show();
        portText.setEditable(visible);
      }
 else {
        portText.hide();
      }
      addContextParams(EDBParamName.Port,false);
    }
    if (s.contains(EDatabaseConnVar.SID.getVariable()) || s.contains(EDatabaseConnVar.SERVICE_NAME.getVariable())) {
      if (!EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {
        if (EDatabaseTypeName.HIVE.getDisplayName().equalsIgnoreCase(dbTypeCombo.getText())) {
          if (isHiveEmbeddedMode()) {
            portText.show();
            serverText.show();
            serverText.setEditable(true);
            hideMappingFileRelatedWidgets(true);
          }
 else {
            portText.show();
            serverText.show();
            serverText.setEditable(true);
            hideMappingFileRelatedWidgets(true);
          }
          sidOrDatabaseText.show();
          sidOrDatabaseText.setEditable(true);
        }
 else {
          sidOrDatabaseText.show();
          sidOrDatabaseText.setEditable(visible);
        }
        addContextParams(sidOrDatabase,visible);
      }
 else {
        sidOrDatabaseText.hide();
        addContextParams(sidOrDatabase,false);
      }
    }
 else {
      if (template.getDbType() != EDatabaseTypeName.JAVADB_EMBEDED && !isHiveDBConnSelected()) {
        sidOrDatabaseText.hide();
        addContextParams(sidOrDatabase,false);
      }
    }
    if (s.contains(EDatabaseConnVar.FILENAME.getVariable())) {
      fileField.show();
      fileField.setEditable(!isReadOnly() && visible);
      addContextParams(EDBParamName.File,visible);
      boolean isSqlLite=false;
      if (template.getDbType() == EDatabaseTypeName.SQLITE) {
        isSqlLite=true;
        usernameText.hide();
        passwordText.hide();
      }
 else {
        isSqlLite=false;
        usernameText.show();
        passwordText.show();
      }
      usernameText.setEditable(!isSqlLite);
      passwordText.setEditable(!isSqlLite);
      addContextParams(EDBParamName.Login,!isSqlLite);
      addContextParams(EDBParamName.Password,!isSqlLite);
    }
 else {
      fileField.hide();
      addContextParams(EDBParamName.File,false);
      usernameText.show();
      passwordText.show();
      if (isHbase || isMaprdb) {
        usernameText.hide();
        passwordText.hide();
      }
 else       if (isImpala) {
        passwordText.hide();
      }
 else       if (isHiveDBConnSelected()) {
        if (isHiveEmbeddedMode()) {
          usernameText.show();
          passwordText.show();
          serverText.setEditable(true);
          hideMappingFileRelatedWidgets(true);
        }
 else {
          usernameText.show();
          passwordText.show();
          hideMappingFileRelatedWidgets(true);
        }
      }
      addContextParams(EDBParamName.Login,true);
      addContextParams(EDBParamName.Password,true);
    }
    if (s.contains(EDatabaseConnVar.DATASOURCE.getVariable())) {
      datasourceText.show();
      datasourceText.setEditable(visible);
      addContextParams(EDBParamName.Datasource,visible);
    }
 else {
      datasourceText.hide();
      addContextParams(EDBParamName.Datasource,false);
    }
    if (s.contains(EDatabaseConnVar.DBROOTPATH.getVariable())) {
      directoryField.show();
      directoryField.setEditable(visible);
      sidOrDatabaseText.setEditable(visible);
      addContextParams(EDBParamName.DBRootPath,visible);
      addContextParams(sidOrDatabase,visible);
    }
 else {
      directoryField.hide();
      addContextParams(EDBParamName.DBRootPath,false);
    }
    if (EDatabaseConnTemplate.isSchemaNeeded(getConnection().getDatabaseType())) {
      schemaText.show();
      schemaText.setEditable(visible);
      if (isHbase || isMaprdb) {
        schemaText.setLabelText("String_Node_Str");
      }
      addContextParams(EDBParamName.Schema,visible);
    }
 else {
      if (!schemaTextIsShow) {
        schemaText.hide();
        addContextParams(EDBParamName.Schema,false);
      }
    }
    if (EDatabaseConnTemplate.isAddtionParamsNeeded(getConnection().getDatabaseType()) && !EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText()) && visible) {
      additionParamText.show();
      additionParamText.setEditable(true);
      addContextParams(EDBParamName.AdditionalParams,true);
    }
 else {
      additionParamText.hide();
      addContextParams(EDBParamName.AdditionalParams,false);
    }
    if (EDatabaseConnTemplate.FIREBIRD.equals(template)) {
      portText.show();
      portText.setEditable(true);
      addContextParams(EDBParamName.Port,true);
    }
    if (isHiveDBConnSelected()) {
      if (isHiveEmbeddedMode()) {
        passwordText.hide();
        portText.show();
        serverText.show();
        hideMappingFileRelatedWidgets(true);
      }
 else {
        portText.show();
        serverText.show();
        usernameText.show();
        passwordText.show();
        hideMappingFileRelatedWidgets(true);
      }
      schemaText.hide();
    }
  }
  doHiveUIContentsLayout();
  hbaseSettingGroup.layout();
  maprdbSettingGroup.layout();
  impalaSettingGroup.layout();
  hadoopPropGrp.layout();
  metastorePropGrp.layout();
  compositeDbSettings.layout();
  typeDbCompositeParent.layout();
  newParent.layout();
  databaseSettingGroup.layout();
  compositeGroupDbSettings.layout();
}

Fixed version (ground truth):
/** 
 * SetEditable fields.
 * @param boolean
 */
@SuppressWarnings("String_Node_Str") private void setPropertiesFormEditable(boolean visible){
  clearContextParams();
  EDBParamName sidOrDatabase=null;
  if (EDatabaseTypeName.ORACLEFORSID.getProduct().equals(getConnection().getProductId())) {
    if (EDatabaseConnTemplate.ORACLESN.getDBDisplayName().equals(getConnection().getDatabaseType())) {
      sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
      sidOrDatabaseText.setLabelWidth(65);
      sidOrDatabase=EDBParamName.ServiceName;
    }
 else     if (EDatabaseConnTemplate.ORACLEFORSID.getDBDisplayName().equals(getConnection().getDatabaseType())) {
      sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
      sidOrDatabase=EDBParamName.Sid;
    }
 else     if (EDatabaseConnTemplate.ORACLE_OCI.getDBDisplayName().equals(getConnection().getDatabaseType())) {
      sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
      sidOrDatabase=EDBParamName.Sid;
    }
  }
 else {
    sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
    sidOrDatabase=EDBParamName.Database;
    if (EDatabaseConnTemplate.INFORMIX.getDBDisplayName().equals(getConnection().getDatabaseType())) {
      sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
    }
  }
  if (EDatabaseTypeName.MSODBC.getDisplayName().equals(dbTypeCombo.getText())) {
    sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
  }
  if (EDatabaseTypeName.GODBC.getDisplayName().equals(dbTypeCombo.getText())) {
    sidOrDatabaseText.setLabelText(Messages.getString("String_Node_Str"));
  }
  if (EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {
    addContextParams(EDBParamName.JdbcUrl,visible);
    addContextParams(EDBParamName.DriverJar,visible);
    addContextParams(EDBParamName.MappingFile,visible);
    addContextParams(EDBParamName.ClassName,visible);
  }
  addContextParams(EDBParamName.Login,visible);
  addContextParams(EDBParamName.Password,visible);
  boolean isOracle=visible && oracleVersionEnable();
  boolean isAS400=visible && as400VersionEnable();
  boolean isMySQL=visible && asMySQLVersionEnable();
  boolean isVertica=visible && asVerticaVersionEnable();
  boolean isSAS=visible && asSASVersionEnable();
  boolean isHbase=visible && asHbaseVersionEnable();
  boolean isMaprdb=visible && asMaprdbVersionEnable();
  boolean isImpala=visible && ImpalaVersionEnable();
  boolean isHive=visible && hiveVersionEnable();
  boolean isMsSQL=visible && asMsSQLVersionEnable();
  dbVersionCombo.setEnabled(!isReadOnly() && (isOracle || isAS400 || isMySQL|| isVertica|| isSAS|| isImpala|| isMsSQL|| EDatabaseConnTemplate.PSQL.getDBTypeName().equals(dbTypeCombo.getText())|| EDatabaseConnTemplate.PLUSPSQL.getDBTypeName().equals(dbTypeCombo.getText())|| EDatabaseConnTemplate.ACCESS.getDBTypeName().equals(dbTypeCombo.getText())|| EDatabaseConnTemplate.MSSQL05_08.getDBDisplayName().equals(dbTypeCombo.getText())));
  usernameText.setEditable(visible);
  passwordText.setEditable(visible);
  serverText.setEditable(false);
  portText.setEditable(false);
  sidOrDatabaseText.setEditable(false);
  datasourceText.setEditable(false);
  additionParamText.setEditable(false);
  schemaText.setEditable(false);
  fileField.setEditable(false);
  directoryField.setEditable(false);
  mappingFileText.setEditable(false);
  mappingSelectButton.setEnabled(false);
  if (EDatabaseConnTemplate.GODBC.getDBTypeName().equals(dbTypeCombo.getText()) || EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {
    addContextParams(EDBParamName.MappingFile,true);
    mappingFileText.show();
    mappingFileText.setEditable(true);
    mappingSelectButton.setVisible(true);
    mappingSelectButton.setEnabled(true);
  }
 else {
    addContextParams(EDBParamName.MappingFile,false);
    mappingFileText.hide();
    mappingFileText.setEditable(false);
    mappingSelectButton.setVisible(false);
    mappingSelectButton.setEnabled(false);
  }
  if (dbTypeCombo.getSelectionIndex() < 0) {
    urlConnectionStringText.setEditable(false);
  }
 else {
    EDatabaseConnTemplate template=EDatabaseConnTemplate.indexOfTemplate(dbTypeCombo.getText());
    String s="String_Node_Str";
    if (template != null) {
      EDatabaseVersion4Drivers version=null;
      if (isHiveDBConnSelected()) {
        boolean isEmbeddedMode=isHiveEmbeddedMode();
        if (doSupportHive2()) {
          if (isEmbeddedMode) {
            s=template.getUrlTemplate(EDatabaseVersion4Drivers.HIVE_2_EMBEDDED);
          }
 else {
            s=template.getUrlTemplate(EDatabaseVersion4Drivers.HIVE_2_STANDALONE);
          }
        }
 else {
          if (isEmbeddedMode) {
            s=template.getUrlTemplate(EDatabaseVersion4Drivers.HIVE_EMBEDDED);
          }
 else {
            s=template.getUrlTemplate(EDatabaseVersion4Drivers.HIVE);
          }
        }
      }
 else {
        version=EDatabaseVersion4Drivers.indexOfByVersionDisplay(dbVersionCombo.getText());
        s=template.getUrlTemplate(version);
      }
    }
    if (isHbase || isMaprdb || isDBTypeSelected(EDatabaseConnTemplate.ORACLE_CUSTOM)|| isDBTypeSelected(EDatabaseConnTemplate.IMPALA)) {
      urlConnectionStringText.hide();
    }
 else {
      urlConnectionStringText.show();
    }
    if (isDBTypeSelected(EDatabaseConnTemplate.ORACLE_CUSTOM)) {
      serverText.setLabelText(Messages.getString("String_Node_Str"));
    }
 else {
      serverText.setLabelText(Messages.getString("String_Node_Str"));
    }
    hideHCLinkSettings(!isHbase && !isMaprdb && !isHiveDBConnSelected());
    hideHBaseSettings(!isHbase);
    hideMaprdbSettings(!isMaprdb);
    hideImpalaSettings(!isImpala);
    updateHadoopPropertiesFieldsState();
    updateHiveJDBCPropertiesFieldsState();
    showIfAdditionalJDBCSettings();
    showIfSupportEncryption();
    showIfAuthentication();
    hideHiveExecutionFields(!doSupportTez());
    urlConnectionStringText.setEditable(!visible);
    boolean schemaTextIsShow=true;
    if (template == EDatabaseConnTemplate.MSSQL) {
      schemaText.show();
      schemaText.setEditable(true);
      addContextParams(EDBParamName.Schema,true);
    }
 else     if (template == EDatabaseConnTemplate.VERTICA || template == EDatabaseConnTemplate.INFORMIX) {
      schemaText.show();
      schemaText.setEditable(true);
      addContextParams(EDBParamName.Schema,true);
    }
 else     if (template == EDatabaseConnTemplate.GENERAL_JDBC) {
      String jdbcUrlString="String_Node_Str";
      if (isContextMode()) {
        if (selectedContextType == null) {
          selectedContextType=ConnectionContextHelper.getContextTypeForContextMode(getShell(),getConnection(),true);
        }
        if (selectedContextType != null) {
          jdbcUrlString=ConnectionContextHelper.getOriginalValue(selectedContextType,getConnection().getURL());
        }
      }
 else {
        jdbcUrlString=generalJdbcUrlText.getText();
      }
      if (jdbcUrlString.contains("String_Node_Str")) {
        jDBCschemaText.setHideWidgets(false);
        addContextParams(EDBParamName.Schema,true);
      }
 else {
        jDBCschemaText.setHideWidgets(true);
        addContextParams(EDBParamName.Schema,false);
      }
    }
 else {
      schemaTextIsShow=false;
    }
    if (s.contains(EDatabaseConnVar.HOST.getVariable()) || isHbase || isMaprdb|| isImpala) {
      if (!EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {
        serverText.show();
        serverText.setEditable(visible);
        if (isHbase) {
          String serverName=getConnection().getServerName();
          if (serverName == null || "String_Node_Str".equals(serverName)) {
            serverText.setText(EDatabaseConnTemplate.HBASE.getUrlTemplate(EDatabaseVersion4Drivers.HBASE));
          }
        }
        if (isMaprdb) {
          String serverName=getConnection().getServerName();
          if (serverName == null || "String_Node_Str".equals(serverName)) {
            serverText.setText(EDatabaseConnTemplate.MAPRDB.getUrlTemplate(EDatabaseVersion4Drivers.MAPRDB));
          }
        }
        if (isImpala) {
          String serverName=getConnection().getServerName();
          if (serverName == null || "String_Node_Str".equals(serverName)) {
            serverText.setText(EDatabaseConnTemplate.IMPALA.getDefaultServer(null));
          }
        }
        if (isHive) {
          String serverName=getConnection().getServerName();
          if (serverName == null || "String_Node_Str".equals(serverName)) {
            serverText.setText(EDatabaseConnTemplate.HIVE.getDefaultServer(EDatabaseVersion4Drivers.HIVE));
          }
        }
        addContextParams(EDBParamName.Server,visible);
      }
    }
 else {
      if (isHiveDBConnSelected()) {
        if (isHiveEmbeddedMode()) {
          portText.show();
          serverText.show();
          portText.setEditable(true);
          serverText.setEditable(true);
          hideMappingFileRelatedWidgets(true);
        }
 else {
          portText.show();
          serverText.show();
          portText.setEditable(true);
          serverText.setEditable(visible);
          hideMappingFileRelatedWidgets(true);
        }
        sidOrDatabaseText.setEditable(true);
      }
 else {
        serverText.hide();
      }
      addContextParams(EDBParamName.Server,false);
    }
    if (s.contains(EDatabaseConnVar.PORT.getVariable()) || isHbase || isMaprdb|| isImpala) {
      portText.show();
      portText.setEditable(visible);
      addContextParams(EDBParamName.Port,visible);
    }
 else {
      if (isHiveDBConnSelected()) {
        portText.show();
        portText.setEditable(visible);
      }
 else {
        portText.hide();
      }
      addContextParams(EDBParamName.Port,false);
    }
    if (s.contains(EDatabaseConnVar.SID.getVariable()) || s.contains(EDatabaseConnVar.SERVICE_NAME.getVariable())) {
      if (!EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText())) {
        if (EDatabaseTypeName.HIVE.getDisplayName().equalsIgnoreCase(dbTypeCombo.getText())) {
          if (isHiveEmbeddedMode()) {
            portText.show();
            serverText.show();
            serverText.setEditable(true);
            hideMappingFileRelatedWidgets(true);
          }
 else {
            portText.show();
            serverText.show();
            serverText.setEditable(true);
            hideMappingFileRelatedWidgets(true);
          }
          sidOrDatabaseText.show();
          sidOrDatabaseText.setEditable(true);
        }
 else {
          sidOrDatabaseText.show();
          sidOrDatabaseText.setEditable(visible);
        }
        addContextParams(sidOrDatabase,visible);
      }
 else {
        sidOrDatabaseText.hide();
        addContextParams(sidOrDatabase,false);
      }
    }
 else {
      if (template.getDbType() != EDatabaseTypeName.JAVADB_EMBEDED && !isHiveDBConnSelected()) {
        sidOrDatabaseText.hide();
        addContextParams(sidOrDatabase,false);
      }
    }
    if (s.contains(EDatabaseConnVar.FILENAME.getVariable())) {
      fileField.show();
      fileField.setEditable(!isReadOnly() && visible);
      addContextParams(EDBParamName.File,visible);
      boolean isSqlLite=false;
      if (template.getDbType() == EDatabaseTypeName.SQLITE) {
        isSqlLite=true;
        usernameText.hide();
        passwordText.hide();
      }
 else {
        isSqlLite=false;
        usernameText.show();
        passwordText.show();
      }
      usernameText.setEditable(!isSqlLite);
      passwordText.setEditable(!isSqlLite);
      addContextParams(EDBParamName.Login,!isSqlLite);
      addContextParams(EDBParamName.Password,!isSqlLite);
    }
 else {
      fileField.hide();
      addContextParams(EDBParamName.File,false);
      usernameText.show();
      passwordText.show();
      if (isHbase || isMaprdb) {
        usernameText.hide();
        passwordText.hide();
      }
 else       if (isImpala) {
        passwordText.hide();
      }
 else       if (isHiveDBConnSelected()) {
        if (isHiveEmbeddedMode()) {
          usernameText.show();
          passwordText.show();
          serverText.setEditable(true);
          hideMappingFileRelatedWidgets(true);
        }
 else {
          usernameText.show();
          passwordText.show();
          hideMappingFileRelatedWidgets(true);
        }
      }
      addContextParams(EDBParamName.Login,true);
      addContextParams(EDBParamName.Password,true);
    }
    if (s.contains(EDatabaseConnVar.DATASOURCE.getVariable())) {
      datasourceText.show();
      datasourceText.setEditable(visible);
      addContextParams(EDBParamName.Datasource,visible);
    }
 else {
      datasourceText.hide();
      addContextParams(EDBParamName.Datasource,false);
    }
    if (s.contains(EDatabaseConnVar.DBROOTPATH.getVariable())) {
      directoryField.show();
      directoryField.setEditable(visible);
      sidOrDatabaseText.setEditable(visible);
      addContextParams(EDBParamName.DBRootPath,visible);
      addContextParams(sidOrDatabase,visible);
    }
 else {
      directoryField.hide();
      addContextParams(EDBParamName.DBRootPath,false);
    }
    if (EDatabaseConnTemplate.isSchemaNeeded(getConnection().getDatabaseType())) {
      schemaText.show();
      schemaText.setEditable(visible);
      if (isHbase || isMaprdb) {
        schemaText.setLabelText("String_Node_Str");
      }
      addContextParams(EDBParamName.Schema,visible);
    }
 else {
      if (!schemaTextIsShow) {
        schemaText.hide();
        addContextParams(EDBParamName.Schema,false);
      }
    }
    if (EDatabaseConnTemplate.isAddtionParamsNeeded(getConnection().getDatabaseType()) && !EDatabaseConnTemplate.GENERAL_JDBC.getDBTypeName().equals(dbTypeCombo.getText()) && visible) {
      additionParamText.show();
      additionParamText.setEditable(true);
      addContextParams(EDBParamName.AdditionalParams,true);
    }
 else {
      additionParamText.hide();
      addContextParams(EDBParamName.AdditionalParams,false);
    }
    if (EDatabaseConnTemplate.FIREBIRD.equals(template)) {
      portText.show();
      portText.setEditable(true);
      addContextParams(EDBParamName.Port,true);
    }
    if (isHiveDBConnSelected()) {
      if (isHiveEmbeddedMode()) {
        passwordText.hide();
        portText.show();
        serverText.show();
        hideMappingFileRelatedWidgets(true);
      }
 else {
        portText.show();
        serverText.show();
        usernameText.show();
        passwordText.show();
        hideMappingFileRelatedWidgets(true);
      }
      schemaText.hide();
    }
  }
  doHiveUIContentsLayout();
  hbaseSettingGroup.layout();
  maprdbSettingGroup.layout();
  impalaSettingGroup.layout();
  hadoopPropGrp.layout();
  metastorePropGrp.layout();
  compositeDbSettings.layout();
  typeDbCompositeParent.layout();
  newParent.layout();
  databaseSettingGroup.layout();
  compositeGroupDbSettings.layout();
}