Search in sources :

Example 1 with AddGlobalMapEntryCommand

use of org.talend.designer.mapper.ui.commands.AddGlobalMapEntryCommand in project tdi-studio-se by Talend.

the class MapperManager method addNewGlobalMapEntry.

/**
     * 
     * @param dataMapTableView
     * @param index
     * @param type TODO
     * @param metadataColumn, can be null if added in VarsTable
     */
public GlobalMapEntry addNewGlobalMapEntry(DataMapTableView dataMapTableView, ITableEntry tableEntrySource, Integer index) {
    IDataMapTable abstractDataMapTable = dataMapTableView.getDataMapTable();
    GlobalMapEntry dataMapTableEntry = null;
    if (dataMapTableView.getZone() == Zone.INPUTS) {
        dataMapTableEntry = new GlobalMapEntry(abstractDataMapTable, "\"" + dataMapTableView.findUniqueName("myKey") + "\"", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
        null);
    } else {
        //$NON-NLS-1$
        throw new IllegalArgumentException(Messages.getString("MapperManager.exceptionMessage.useOtherSignature"));
    }
    AddGlobalMapEntryCommand command = new AddGlobalMapEntryCommand(tableEntriesManager, dataMapTableEntry, index);
    executeCommand(command);
    return dataMapTableEntry;
}
Also used : AddGlobalMapEntryCommand(org.talend.designer.mapper.ui.commands.AddGlobalMapEntryCommand) IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) GlobalMapEntry(org.talend.designer.mapper.model.tableentry.GlobalMapEntry)

Aggregations

IDataMapTable (org.talend.designer.abstractmap.model.table.IDataMapTable)1 GlobalMapEntry (org.talend.designer.mapper.model.tableentry.GlobalMapEntry)1 AddGlobalMapEntryCommand (org.talend.designer.mapper.ui.commands.AddGlobalMapEntryCommand)1