use of org.talend.designer.mapper.ui.commands.AddVarEntryCommand in project tdi-studio-se by Talend.
the class MapperManager method addNewVarEntry.
/**
* This method is called when "addMetadataTableEditorEntry" is called (event on list of MetadataEditor) , so if you
* want keep synchronisation between inputs/outputs DataMaps and MetadataEditors don't call this method.
*
* For other uses such as add an entry to VarsTable or add entries to inputs or outputs DataMaps when
* MetadataEditors are not active, call it.
*
* @param dataMapTableView
* @param index
* @param type TODO
* @param metadataColumn, can be null if added in VarsTable
*/
public VarTableEntry addNewVarEntry(DataMapTableView dataMapTableView, String name, Integer index, String type) {
IDataMapTable abstractDataMapTable = dataMapTableView.getDataMapTable();
VarTableEntry dataMapTableEntry = null;
if (dataMapTableView.getZone() == Zone.VARS) {
dataMapTableEntry = new VarTableEntry(abstractDataMapTable, name, null, type);
} else {
//$NON-NLS-1$
throw new IllegalArgumentException(Messages.getString("MapperManager.exceptionMessage.useOtherSignature"));
}
AddVarEntryCommand varEntryCommand = new AddVarEntryCommand(tableEntriesManager, dataMapTableEntry, index);
executeCommand(varEntryCommand);
return dataMapTableEntry;
}
Aggregations