use of org.talend.designer.mapper.model.table.OutputTable in project tdi-studio-se by Talend.
the class OutputDataMapTableView method refreshCondensedImage.
@Override
protected void refreshCondensedImage(AbstractInOutTable absTable, String option) {
OutputTable table = (OutputTable) absTable;
if (OUTPUT_REJECT.equals(option)) {
if (mapperManager.getDefaultSetting().get(OUTPUT_REJECT).equals(table.isReject())) {
if (changedOptions > 0) {
changedOptions--;
}
} else {
if (changedOptions < 6) {
changedOptions++;
}
}
} else if (LOOK_UP_INNER_JOIN_REJECT.equals(option)) {
if (mapperManager.getDefaultSetting().get(LOOK_UP_INNER_JOIN_REJECT).equals(table.isRejectInnerJoin())) {
if (changedOptions > 0) {
changedOptions--;
}
} else {
if (changedOptions < 6) {
changedOptions++;
}
}
} else if (SCHEMA_TYPE.equals(option)) {
if (mapperManager.getDefaultSetting().get(SCHEMA_TYPE).equals(table.isRepository())) {
if (changedOptions > 0) {
changedOptions--;
}
} else {
if (changedOptions < 6) {
changedOptions++;
}
}
} else if (SCHEMA_ID.equals(option)) {
if (mapperManager.getDefaultSetting().get(SCHEMA_ID) == table.getId()) {
if (changedOptions > 0) {
changedOptions--;
}
} else {
if (changedOptions < 6) {
changedOptions++;
}
}
}
condensedItem.setImage(ImageProviderMapper.getImage(getCondencedItemImage(changedOptions)));
}
use of org.talend.designer.mapper.model.table.OutputTable in project tdi-studio-se by Talend.
the class UIManager method removeOutputTableView.
/**
* Call mapperManager.removeSelectedOutput() to remove a table view.
*
* @param dataMapTableViewToRemove
*/
public void removeOutputTableView(DataMapTableView dataMapTableViewToRemove) {
List<DataMapTableView> outputsTablesView = mapperManager.getUiManager().getOutputsTablesView();
int sizeList = outputsTablesView.size();
for (int i = 0; i < sizeList; i++) {
Control control = outputsTablesView.get(i);
if (control == dataMapTableViewToRemove && i < sizeList - 1 && i > 0) {
FormData formData = (FormData) outputsTablesView.get(i + 1).getLayoutData();
formData.top = new FormAttachment(outputsTablesView.get(i - 1));
break;
}
}
mapperManager.removeTablePair(dataMapTableViewToRemove);
MetadataTableEditorView outputMetaEditorView = getOutputMetaEditorView();
if (outputMetaEditorView.getMetadataTableEditor() != null && outputMetaEditorView.getMetadataTableEditor().getMetadataTable() == ((OutputTable) dataMapTableViewToRemove.getDataMapTable()).getMetadataTable()) {
getOutputMetaEditorView().setMetadataTableEditor(null);
}
dataMapTableViewToRemove.dispose();
dataMapTableViewToRemove = null;
getTablesZoneViewOutputs().layout();
refreshBackground(true, false);
this.currentSelectedOutputTableView = null;
}
use of org.talend.designer.mapper.model.table.OutputTable in project tdi-studio-se by Talend.
the class UIManager method updateToolbarButtonsStates.
/**
* DOC amaumont Comment method "updateToolbarButtonsStates".
*
* @param currentZone
*/
public void updateToolbarButtonsStates(Zone currentZone) {
ToolbarZone toolbar = null;
if (currentZone == Zone.INPUTS) {
toolbar = getInputsZone().getToolbar();
toolbar.setEnabledMinimizeTablesButton(mapperManager.getUiManager().getInputsTablesView().size() > 0);
} else if (currentZone == Zone.OUTPUTS) {
toolbar = getOutputsZone().getToolbar();
((ToolbarOutputZone) toolbar).setEnabledRemoveTableButton(currentSelectedOutputTableView != null && currentSelectedOutputTableView.getDataMapTable() instanceof OutputTable && !((OutputTable) currentSelectedOutputTableView.getDataMapTable()).isErrorRejectTable());
toolbar.setEnabledMinimizeTablesButton(mapperManager.getUiManager().getOutputsTablesView().size() > 0);
}
toolbar.setEnabledMoveTableButton(true, isTableViewMoveable(currentZone, true));
toolbar.setEnabledMoveTableButton(false, isTableViewMoveable(currentZone, false));
}
use of org.talend.designer.mapper.model.table.OutputTable 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.OutputTable 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