private boolean nameExist(String name) {
    existedNames.clear();
    for (int i = 0; i < this.temConnection.getModules().size(); i++) {
      if (this.temConnection.getModules().get(i).getModuleName().equals(moduleName)) {
        for (int j = 0; j < temConnection.getModules().get(i).getTables().size(); j++) {
          existedNames.add(temConnection.getModules().get(i).getTables().get(j).getLabel());
        }
        break;
      }
    }
    boolean result = false;
    int number = 0;
    for (int i = 0; i < this.existedNames.size(); i++) {
      if (existedNames.get(i).equals(name)) {
        number++;
      }
    }
    if (number > 1) {
      result = true;
    } else {
      result = false;
    }

    return result;
  }
 private void initTreeNavigatorNodes() {
   List<String> selectedNames = new ArrayList<String>();
   EList<SalesforceModuleUnit> modules = temConnection.getModules();
   // EList<SalesforceModuleUnit> modules = getConnection().getModules();
   for (int i = 0; i < modules.size(); i++) {
     if (modules.get(i).getModuleName().equals(moduleName)) {
       for (int j = 0; j < modules.get(i).getTables().size(); j++) {
         selectedNames.add(modules.get(i).getTables().get(j).getLabel());
       }
       break;
     }
   }
   tableNavigator.removeAll();
   TableItem subItem = null;
   String lastSelectName = null;
   if (selectedNames != null && selectedNames.size() >= 1) {
     for (int i = 0; i < selectedNames.size(); i++) {
       subItem = new TableItem(tableNavigator, SWT.NULL);
       subItem.setText(selectedNames.get(i));
       lastSelectName = selectedNames.get(i);
     }
     metadataNameText.setText(subItem.getText());
     tableNavigator.setSelection(subItem);
     metadataTable = getTableByLabel(lastSelectName);
   } else {
     subItem = new TableItem(tableNavigator, SWT.NULL);
     subItem.setText(moduleName);
   }
   metadataEditor.setMetadataTable(metadataTable);
 }
 @Override
 protected org.talend.core.model.metadata.builder.connection.MetadataTable getTableByLabel(
     String label) {
   org.talend.core.model.metadata.builder.connection.MetadataTable result = null;
   EList<SalesforceModuleUnit> modules = temConnection.getModules();
   for (int i = 0; i < modules.size(); i++) {
     if (modules.get(i).getModuleName().equals(moduleName)) {
       for (int j = 0; j < modules.get(i).getTables().size(); j++) {
         if (modules.get(i).getTables().get(j).getLabel().equals(label)) {
           result = modules.get(i).getTables().get(j);
         }
       }
     }
   }
   return result;
 }
  protected void addMetadataTable() {
    // Create a new metadata and Add it on the connection
    IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
    metadataTable = ConnectionFactory.eINSTANCE.createMetadataTable();
    metadataTable.setId(factory.getNextId());
    // initExistingNames();

    metadataTable.setLabel(IndiceHelper.getIndexedLabel(metadataTable.getLabel(), existingNames));
    EList<SalesforceModuleUnit> modules = temConnection.getModules();
    // EList<SalesforceModuleUnit> modules = getConnection().getModules();
    for (int i = 0; i < modules.size(); i++) {
      if (modules.get(i).getModuleName().equals(moduleName)) {

        modules.get(i).getTables().add(modules.get(i).getTables().size(), metadataTable);
        break;
      }
    }
    // init TreeNavigator
    initTreeNavigatorNodes();
    metadataNameText.setText(metadataTable.getLabel());
  }