use of org.talend.designer.mapper.model.table.InputTable in project tdi-studio-se by Talend.
the class InputDataMapTableView method addToolItems.
/*
* (non-Javadoc)
*
* @see org.talend.designer.mapper.ui.visualmap.table.DataMapTableView#addEntriesActionsComponents()
*/
@Override
protected boolean addToolItems() {
// TODO: unlock this tentatively.
if (!getInputTable().isMainConnection()) {
final InputTable table = getInputTable();
// condensed Item
condensedItem = new ToolItem(toolBarActions, SWT.CHECK);
// condensedItem.setEnabled(!mapperManager.componentIsReadOnly());
condensedItem.setSelection(table.isActivateCondensedTool());
condensedItem.setToolTipText("tMap settings");
initCondensedItemImage();
condensedItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
table.setActivateCondensedTool(condensedItem.getSelection());
showTableMapSetting(condensedItem.getSelection());
}
});
if (mapperManager.isPersistentMap()) {
TMAP_LOOKUP_MODE lookupMode = (TMAP_LOOKUP_MODE) table.getLookupMode();
switch(lookupMode) {
case LOAD_ONCE:
case LOAD_ONCE_AND_UPDATE:
case RELOAD:
persistentCheckEditable = true;
previousValidPersistentMode = table.isPersistent();
break;
case CACHE_OR_RELOAD:
persistentCheckEditable = false;
getInputTable().setPersistent(false);
break;
default:
break;
}
}
}
createActivateFilterCheck();
createColumnNameFilterCheck();
return true;
}
use of org.talend.designer.mapper.model.table.InputTable in project tdi-studio-se by Talend.
the class ExternalDataConverter method loadInExternalData.
private void loadInExternalData(Collection<? extends AbstractDataMapTable> tables) {
for (IDataMapTable table : tables) {
ExternalMapperTable externalMapperTable = new ExternalMapperTable();
fillExternalTable(table, externalMapperTable);
ArrayList<ExternalMapperTableEntry> perTableEntries = new ArrayList<ExternalMapperTableEntry>();
boolean isVarTable = table instanceof VarsTable;
boolean isInputTable = table instanceof InputTable;
for (ITableEntry dataMapTableEntry : table.getColumnEntries()) {
ExternalMapperTableEntry externalMapperTableEntry = new ExternalMapperTableEntry();
externalMapperTableEntry.setExpression(dataMapTableEntry.getExpression());
externalMapperTableEntry.setName(dataMapTableEntry.getName());
if (isVarTable) {
externalMapperTableEntry.setType(((VarTableEntry) dataMapTableEntry).getType());
externalMapperTableEntry.setNullable(((VarTableEntry) dataMapTableEntry).isNullable());
} else {
externalMapperTableEntry.setType(((AbstractInOutTableEntry) dataMapTableEntry).getMetadataColumn().getTalendType());
externalMapperTableEntry.setNullable(((AbstractInOutTableEntry) dataMapTableEntry).getMetadataColumn().isNullable());
}
if (isInputTable) {
externalMapperTableEntry.setOperator(((InputColumnTableEntry) dataMapTableEntry).getOperator());
}
perTableEntries.add(externalMapperTableEntry);
}
externalMapperTable.setMetadataTableEntries(perTableEntries);
}
}
use of org.talend.designer.mapper.model.table.InputTable in project tdi-studio-se by Talend.
the class MapperMain method getMetadataListIn.
/**
* DOC amaumont Comment method "getMetadataListIn".
*/
public List<IMetadataTable> getMetadataListIn() {
List<InputTable> tables = mapperManager.getInputTables();
List<IMetadataTable> metadataTables = new ArrayList<IMetadataTable>(tables.size());
for (InputTable table : tables) {
metadataTables.add(table.getMetadataTable());
}
return metadataTables;
}
use of org.talend.designer.mapper.model.table.InputTable in project tdi-studio-se by Talend.
the class TableEntriesManager method addTableEntry.
/**
* DOC amaumont Comment method "addTableEntry".
*
* @param dataMapTableEntry
* @param index
*/
public void addTableEntry(ITableEntry dataMapTableEntry, Integer index) {
if (dataMapTableEntry == null) {
throw new IllegalArgumentException(Messages.getString(//$NON-NLS-1$
"TableEntriesManager.exceptionMessage.dataMapTableEntryCannotNull"));
}
add(dataMapTableEntry);
IDataMapTable dataMapTable = dataMapTableEntry.getParent();
if (dataMapTableEntry instanceof IColumnEntry) {
if (index == null) {
dataMapTable.addColumnEntry((IColumnEntry) dataMapTableEntry);
} else {
dataMapTable.addColumnEntry((IColumnEntry) dataMapTableEntry, index);
}
} else if (dataMapTableEntry instanceof FilterTableEntry) {
if (index == null) {
((OutputTable) dataMapTable).addFilterEntry((FilterTableEntry) dataMapTableEntry);
} else {
((OutputTable) dataMapTable).addFilterEntry((FilterTableEntry) dataMapTableEntry, index);
}
} else if (dataMapTableEntry instanceof GlobalMapEntry) {
if (index == null) {
((InputTable) dataMapTable).addGlobalMapEntry((GlobalMapEntry) dataMapTableEntry);
} else {
((InputTable) dataMapTable).addGlobalMapEntry((GlobalMapEntry) dataMapTableEntry, index);
}
} else {
String exceptionMessage = Messages.getString("TableEntriesManager.exceptionMessage.typeIsNotValid", //$NON-NLS-1$
dataMapTableEntry.getClass().toString());
throw new IllegalArgumentException(exceptionMessage);
}
// TableEntriesManagerEvent event = new TableEntriesManagerEvent(EVENT_TYPE.ADD);
// event.entry = dataMapTableEntry;
// fireEvent(event);
}
Aggregations