use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class UIManager method processColumnNameChanged.
/**
* DOC amaumont Comment method "processNewProcessColumnName".
*
* @param previousColumnName TODO
* @param dataMapTableView
* @param text
* @param entry
*/
public void processColumnNameChanged(final String previousColumnName, final String newColumnName, final DataMapTableView dataMapTableView, final ITableEntry currentModifiedITableEntry) {
mapperManager.changeColumnName(currentModifiedITableEntry, previousColumnName, newColumnName);
Collection<DataMapTableView> tableViews = mapperManager.getTablesView();
boolean atLeastOneLinkHasBeenRemoved = false;
for (DataMapTableView view : tableViews) {
IDataMapTable dataMapTable = view.getDataMapTable();
List<IColumnEntry> metadataTableEntries = dataMapTable.getColumnEntries();
for (IColumnEntry entry : metadataTableEntries) {
if (parseExpression(entry.getExpression(), entry, true, true, false).isAtLeastOneLinkRemoved()) {
atLeastOneLinkHasBeenRemoved = true;
}
}
// for the input/output table expression filter
if (dataMapTable instanceof AbstractInOutTable) {
ExpressionFilterEntry expressionFilterEntry = ((AbstractInOutTable) dataMapTable).getExpressionFilter();
if (expressionFilterEntry != null && expressionFilterEntry.getExpression() != null) {
if (parseExpression(expressionFilterEntry.getExpression(), expressionFilterEntry, true, true, false).isAtLeastOneLinkRemoved()) {
atLeastOneLinkHasBeenRemoved = true;
}
}
}
}
mapperManager.getUiManager().refreshBackground(false, false);
dataMapTableView.getTableViewerCreatorForColumns().getTableViewer().refresh(currentModifiedITableEntry);
if (atLeastOneLinkHasBeenRemoved) {
new AsynchronousThreading(20, false, dataMapTableView.getDisplay(), new Runnable() {
public void run() {
TableViewerCreator tableViewerCreatorForColumns = dataMapTableView.getTableViewerCreatorForColumns();
boolean propagate = MessageDialog.openQuestion(tableViewerCreatorForColumns.getTable().getShell(), //$NON-NLS-1$
Messages.getString("UIManager.propagateTitle"), //$NON-NLS-1$
Messages.getString("UIManager.propagateMessage"));
if (propagate) {
TableEntryLocation previousLocation = new TableEntryLocation(currentModifiedITableEntry.getParentName(), previousColumnName);
TableEntryLocation newLocation = new TableEntryLocation(currentModifiedITableEntry.getParentName(), newColumnName);
mapperManager.replacePreviousLocationInAllExpressions(previousLocation, newLocation);
}
}
}).start();
}
}
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 dataMapTableView
*/
private void refreshInOutTableAndMetaTable(DataMapTableView dataMapTableView) {
IMetadataTable metadataTableTarget = ((AbstractInOutTable) dataMapTableView.getDataMapTable()).getMetadataTable();
dataMapTableView.getTableViewerCreatorForColumns().getTableViewer().refresh();
MetadataTableEditorView metadataEditorView = getMetadataEditorView(dataMapTableView.getZone());
if (metadataEditorView != null && metadataEditorView.getMetadataTableEditor() != null && metadataEditorView.getMetadataTableEditor().getMetadataTable() == metadataTableTarget) {
metadataEditorView.getTableViewerCreator().getTableViewer().refresh();
metadataEditorView.getTableViewerCreator().refreshTableEditorControls();
}
}
use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class MapperManager method replacePreviousLocationInAllExpressions.
/**
* DOC amaumont Comment method "replacePreviousLocationInAllExpressions".
*/
public void replacePreviousLocationInAllExpressions(final TableEntryLocation previousLocation, final TableEntryLocation newLocation) {
DataMapExpressionParser dataMapExpressionParser = new DataMapExpressionParser(LanguageProvider.getCurrentLanguage());
Collection<IDataMapTable> tablesData = getTablesData();
for (IDataMapTable table : tablesData) {
List<IColumnEntry> columnEntries = table.getColumnEntries();
if (table instanceof AbstractInOutTable) {
replaceLocation(previousLocation, newLocation, dataMapExpressionParser, table, ((AbstractInOutTable) table).getExpressionFilter());
}
for (IColumnEntry entry : columnEntries) {
replaceLocation(previousLocation, newLocation, dataMapExpressionParser, table, entry);
}
if (table instanceof OutputTable) {
List<FilterTableEntry> constraintEntries = ((OutputTable) table).getFilterEntries();
for (FilterTableEntry entry : constraintEntries) {
replaceLocation(previousLocation, newLocation, dataMapExpressionParser, table, entry);
}
}
}
uiManager.refreshBackground(false, false);
}
use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class ProblemsManager method checkProblemsForAllEntries.
/**
*
* DOC amaumont Comment method "checkProblemsForAllEntries".
*
* @param dataMapTableView
* @param forceRefreshData
* @return true if has errors
*/
@SuppressWarnings("unchecked")
public boolean checkProblemsForAllEntries(DataMapTableView dataMapTableView, boolean forceRefreshData) {
if (forceRefreshData) {
mapperManager.getAbstractMapComponent().restoreMapperModelFromInternalData();
checkProblems();
}
boolean hasProblemsWasNull = false;
if (hasProblems == null) {
hasProblems = Boolean.FALSE;
hasProblemsWasNull = true;
}
if (dataMapTableView.getDataMapTable() instanceof AbstractInOutTable) {
AbstractInOutTable table = (AbstractInOutTable) dataMapTableView.getDataMapTable();
if (table.isActivateExpressionFilter()) {
checkProblemsForTableEntry(table.getExpressionFilter(), false);
}
}
List<IColumnEntry> columnsEntriesList = dataMapTableView.getDataMapTable().getColumnEntries();
checkProblemsForAllEntries(columnsEntriesList);
if (refreshTableEntries) {
dataMapTableView.getTableViewerCreatorForColumns().getTableViewer().refresh(true);
}
if (dataMapTableView.getZone() == Zone.OUTPUTS) {
List<ITableEntry> constraintEntriesList = dataMapTableView.getTableViewerCreatorForFilters().getInputList();
checkProblemsForAllEntries(constraintEntriesList);
if (refreshTableEntries) {
dataMapTableView.getTableViewerCreatorForFilters().getTableViewer().refresh(true);
}
}
boolean returnedValue = hasProblems;
if (hasProblemsWasNull) {
hasProblems = null;
}
return returnedValue;
}
use of org.talend.designer.mapper.model.table.AbstractInOutTable in project tdi-studio-se by Talend.
the class TableManager method addTable.
/**
* DOC amaumont Comment method "addTable".
*
* @param view
* @param tableData
*/
//$NON-NLS-1$
@SuppressWarnings("unchecked")
void addTable(DataMapTableView view, IDataMapTable tableData) {
if (tableData instanceof AbstractInOutTable) {
AbstractInOutTable data = (AbstractInOutTable) tableData;
metadataTableToAbstractDataMapTable.put(data.getMetadataTable(), data);
}
if (tableData.getMapperManager() != null)
if (tableData instanceof OutputTable && ((OutputTable) tableData).isErrorRejectTable()) {
getMatchedList(tableData).add(0, tableData);
} else {
getMatchedList(tableData).add(tableData);
}
if (view.getZone() == Zone.INPUTS || view.getZone() == Zone.OUTPUTS) {
swtTableToView.put(view.getExpressionFilterText(), view);
swtTableToView.put(view.getColumnNameFilterText(), view);
}
swtTableToView.put(view.getTableViewerCreatorForColumns().getTable(), view);
if (view.getTableViewerCreatorForFilters() != null) {
swtTableToView.put(view.getTableViewerCreatorForFilters().getTable(), view);
}
if (view.getTableViewerCreatorForGlobalMap() != null) {
swtTableToView.put(view.getTableViewerCreatorForGlobalMap().getTable(), view);
}
abstractDataMapTableToView.put(tableData, view);
}
Aggregations