use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class UIManager method parseAllExpressions.
/**
* DOC amaumont Comment method "processAllExpressions".
*
* @param newLinksMustHaveSelectedState TODO
*/
@SuppressWarnings("unchecked")
public void parseAllExpressions(DataMapTableView dataMapTableView, boolean newLinksMustHaveSelectedState) {
List<IColumnEntry> columnsEntriesList = dataMapTableView.getDataMapTable().getColumnEntries();
parseAllExpressions(columnsEntriesList, newLinksMustHaveSelectedState);
if (mapperManager.isAdvancedMap() && (dataMapTableView.getZone() == Zone.INPUTS || dataMapTableView.getZone() == Zone.OUTPUTS)) {
AbstractInOutTable table = (AbstractInOutTable) dataMapTableView.getDataMapTable();
if (dataMapTableView.getZone() == Zone.INPUTS) {
InputTable inputTable = (InputTable) table;
List<GlobalMapEntry> globalMapEntries = inputTable.getGlobalMapEntries();
if (globalMapEntries != null && !inputTable.isMainConnection()) {
parseAllExpressions(globalMapEntries, newLinksMustHaveSelectedState);
}
}
if (table.isActivateExpressionFilter()) {
ExpressionFilterEntry expressionFilter = table.getExpressionFilter();
parseExpression(expressionFilter.getExpression(), expressionFilter, newLinksMustHaveSelectedState, false, false);
}
} else if (dataMapTableView.getZone() == Zone.OUTPUTS) {
List<ITableEntry> constraintEntriesList = dataMapTableView.getTableViewerCreatorForFilters().getInputList();
parseAllExpressions(constraintEntriesList, newLinksMustHaveSelectedState);
}
}
use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class UIManager method refreshInOutTableAndMetaTable.
/**
* DOC amaumont Comment method "refreshInOutTableAndMetaTable".
*
* @param currentModifiedTableEntry can be null
*/
private void refreshInOutTableAndMetaTable(AbstractInOutTableEntry currentModifiedTableEntry) {
DataMapTableView dataMapTableView = mapperManager.retrieveDataMapTableView(currentModifiedTableEntry);
IMetadataTable metadataTableTarget = ((AbstractInOutTable) dataMapTableView.getDataMapTable()).getMetadataTable();
dataMapTableView.getTableViewerCreatorForColumns().getTableViewer().refresh(currentModifiedTableEntry);
MetadataTableEditorView metadataEditorView = getMetadataEditorView(dataMapTableView.getZone());
if (metadataEditorView != null && metadataEditorView.getMetadataTableEditor() != null && metadataEditorView.getMetadataTableEditor().getMetadataTable() == metadataTableTarget) {
metadataEditorView.getTableViewerCreator().getTableViewer().refresh(currentModifiedTableEntry.getMetadataColumn());
metadataEditorView.getTableViewerCreator().refreshTableEditorControls();
}
}
use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class UIManager method setTraceFilterParaMapper.
/**
* DOC wzhang Comment method "setTraceFilterParaMapper".
*/
public void setTraceFilterParaMapper(Map<IConnection, Set<String>> preColumnSet, List<? extends AbstractInOutTable> curTables, Map<IConnection, Map<String, String>> changedColumnMap) {
for (IConnection curConn : preColumnSet.keySet()) {
Set<String> addedColumns = new HashSet<String>();
Set<String> preColSet = preColumnSet.get(curConn);
Map<String, String> changedColumns = changedColumnMap.get(curConn);
for (AbstractInOutTable table : curTables) {
String curTableName = table.getName();
if (curTableName.equals(curConn.getUniqueName())) {
if (changedColumns != null) {
for (String newName : changedColumns.keySet()) {
String oldName = changedColumns.get(newName);
if (preColSet.contains(oldName)) {
preColSet.remove(oldName);
preColSet.add(newName);
}
}
}
List<IMetadataColumn> curTableColumn = table.getMetadataTable().getListColumns();
for (IMetadataColumn curColumn : curTableColumn) {
if (!(preColSet.contains(curColumn.getLabel()))) {
addedColumns.add(curColumn.getLabel());
}
}
}
}
CorePlugin.getDefault().getDesignerCoreService().updateTraceColumnValues(curConn, changedColumns, addedColumns);
}
}
use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class MapperManager method removeTablePair.
/**
*
* Remove the <code>DataMapTableView</code>-<code>DataMapTable</code> pair.
*
* @param view
*/
public void removeTablePair(DataMapTableView view) {
IDataMapTable dataTable = tableManager.getData(view);
List<IColumnEntry> dataMapTableEntries = dataTable.getColumnEntries();
if (isAdvancedMap() && dataTable instanceof AbstractInOutTable) {
tableEntriesManager.removeAll(Arrays.asList(((AbstractInOutTable) dataTable).getExpressionFilter()));
}
tableEntriesManager.removeAll(dataMapTableEntries);
if (dataTable instanceof OutputTable) {
List<FilterTableEntry> constraintEntries = ((OutputTable) dataTable).getFilterEntries();
tableEntriesManager.removeAll(constraintEntries);
}
tableManager.removeTable(view);
}
use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class InputDataMapTableView method createGlobalMapTable.
protected void createGlobalMapTable() {
this.extendedTableViewerForGlobalMap = new AbstractExtendedTableViewer<GlobalMapEntry>(((InputTable) abstractDataMapTable).getTableGlobalMapEntriesModel(), centerComposite) {
@Override
protected void createColumns(TableViewerCreator<GlobalMapEntry> tableViewerCreator, Table table) {
createGlobalMapColumns(tableViewerCreator);
}
/*
* (non-Javadoc)
*
* @see
* org.talend.commons.ui.swt.extended.macrotable.AbstractExtendedTableViewer#setTableViewerCreatorOptions
* (org.talend.commons.ui.swt.tableviewer.TableViewerCreator)
*/
@Override
protected void setTableViewerCreatorOptions(TableViewerCreator<GlobalMapEntry> newTableViewerCreator) {
super.setTableViewerCreatorOptions(newTableViewerCreator);
newTableViewerCreator.setColumnsResizableByDefault(true);
newTableViewerCreator.setShowLineSelection(SHOW_ROW_SELECTION.FULL);
newTableViewerCreator.setBorderVisible(false);
newTableViewerCreator.setLayoutMode(LAYOUT_MODE.FILL_HORIZONTAL);
newTableViewerCreator.setKeyboardManagementForCellEdition(true);
newTableViewerCreator.setHorizontalScroll(false);
newTableViewerCreator.setVerticalScroll(false);
// tableViewerCreatorForColumns.setUseCustomItemColoring(this.getDataMapTable()
// instanceof
// AbstractInOutTable);
newTableViewerCreator.setFirstColumnMasked(true);
}
};
tableViewerCreatorForGlobalMap = this.extendedTableViewerForGlobalMap.getTableViewerCreator();
if (mapperManager.componentIsReadOnly()) {
tableViewerCreatorForGlobalMap.setReadOnly(true);
}
this.extendedTableViewerForGlobalMap.setCommandStack(mapperManager.getCommandStack());
tableForGlobalMap = tableViewerCreatorForGlobalMap.getTable();
tableForGlobalMapGridData = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
tableForGlobalMap.setLayoutData(tableForGlobalMapGridData);
boolean tableGlobalMapVisible = false;
if (abstractDataMapTable instanceof InputTable) {
IUILookupMode lookupMode = ((InputTable) abstractDataMapTable).getLookupMode();
tableGlobalMapVisible = lookupMode == TMAP_LOOKUP_MODE.RELOAD || lookupMode == TMAP_LOOKUP_MODE.CACHE_OR_RELOAD;
}
tableForGlobalMapGridData.exclude = !tableGlobalMapVisible;
tableForGlobalMap.setVisible(tableGlobalMapVisible);
if (!mapperManager.componentIsReadOnly()) {
new DragNDrop(mapperManager, tableForGlobalMap, false, true);
}
tableViewerCreatorForGlobalMap.addCellValueModifiedListener(new ITableCellValueModifiedListener() {
public void cellValueModified(TableCellValueModifiedEvent e) {
unselectAllEntriesIfErrorDetected(e);
}
});
final TableViewer tableViewer = tableViewerCreatorForGlobalMap.getTableViewer();
tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
selectThisDataMapTableView();
UIManager uiManager = mapperManager.getUiManager();
uiManager.selectLinks(InputDataMapTableView.this, uiManager.extractSelectedTableEntries(selection), false, false);
}
});
tableForGlobalMap.addListener(SWT.KeyDown, new Listener() {
public void handleEvent(Event event) {
processEnterKeyDown(tableViewerCreatorForGlobalMap, event);
}
});
tableViewerCreatorForGlobalMap.setLabelProvider(new DefaultTableLabelProvider(tableViewerCreatorForGlobalMap) {
@Override
public Color getBackground(Object element, int columnIndex) {
return getBackgroundCellColor(tableViewerCreator, element, columnIndex);
}
@Override
public Color getForeground(Object element, int columnIndex) {
return getForegroundCellColor(tableViewerCreator, element, columnIndex);
}
});
initShowMessageErrorListener(tableForGlobalMap);
}
Aggregations