Search in sources :

Example 1 with AddVarEntryCommand

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;
}
Also used : AddVarEntryCommand(org.talend.designer.mapper.ui.commands.AddVarEntryCommand) IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) VarTableEntry(org.talend.designer.mapper.model.tableentry.VarTableEntry)

Aggregations

IDataMapTable (org.talend.designer.abstractmap.model.table.IDataMapTable)1 VarTableEntry (org.talend.designer.mapper.model.tableentry.VarTableEntry)1 AddVarEntryCommand (org.talend.designer.mapper.ui.commands.AddVarEntryCommand)1