use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class MapperManager method addOutput.
/**
* DOC amaumont Comment method "addOutput".
*/
public void addOutput() {
String tableName = uiManager.openNewOutputCreationDialog();
if (tableName == null) {
return;
}
IProcess process = mapperComponent.getProcess();
//$NON-NLS-1$
String uniqueName = process.generateUniqueConnectionName("table");
process.addUniqueConnectionName(uniqueName);
MetadataTable metadataTable = new MetadataTable();
metadataTable.setTableName(uniqueName);
// metadataTable.setId(uniqueName);
metadataTable.setLabel(tableName);
List<DataMapTableView> outputsTablesView = getUiManager().getOutputsTablesView();
int sizeOutputsView = outputsTablesView.size();
Control lastChild = null;
if (sizeOutputsView - 1 >= 0) {
lastChild = outputsTablesView.get(sizeOutputsView - 1);
}
IDataMapTable abstractDataMapTable = new OutputTable(this, metadataTable, uniqueName, tableName);
TablesZoneView tablesZoneViewOutputs = uiManager.getTablesZoneViewOutputs();
DataMapTableView dataMapTableView = uiManager.createNewOutputTableView(lastChild, abstractDataMapTable, tablesZoneViewOutputs);
tablesZoneViewOutputs.setSize(tablesZoneViewOutputs.computeSize(SWT.DEFAULT, SWT.DEFAULT));
tablesZoneViewOutputs.layout();
uiManager.moveOutputScrollBarZoneToMax();
uiManager.refreshBackground(true, false);
tablesZoneViewOutputs.layout();
uiManager.selectDataMapTableView(dataMapTableView, true, false);
}
use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class MapperManager method changeEntryExpression.
/**
* DOC amaumont Comment method "changeEntryExpression".
*
* @param currentEntry
* @param text
*/
public void changeEntryExpression(ITableEntry currentEntry, String text) {
currentEntry.setExpression(text);
getProblemsManager().checkProblemsForTableEntry(currentEntry, true);
DataMapTableView dataMapTableView = retrieveDataMapTableView(currentEntry);
TableViewer tableViewer = null;
if (currentEntry instanceof IColumnEntry) {
tableViewer = dataMapTableView.getTableViewerCreatorForColumns().getTableViewer();
} else if (currentEntry instanceof FilterTableEntry) {
if (FilterTableEntry.OTHER_FILTER.equals(((FilterTableEntry) currentEntry).getFilterKind())) {
tableViewer = dataMapTableView.getTableViewerCreatorForOtherFilters().getTableViewer();
} else {
tableViewer = dataMapTableView.getTableViewerCreatorForWhereFilters().getTableViewer();
}
}
if (currentEntry.getProblems() != null) {
tableViewer.getTable().deselectAll();
}
tableViewer.refresh(currentEntry);
uiManager.parseNewExpression(text, currentEntry, false);
uiManager.refreshSqlExpression();
}
use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class ProblemsManager method checkProblemsForAllEntriesOfAllTables.
/**
* DOC amaumont Comment method "checkProblemsForAllEntries".
*
* @param forceRefreshData TODO
*/
public void checkProblemsForAllEntriesOfAllTables(boolean forceRefreshData) {
List<DataMapTableView> tablesView = mapperManager.getUiManager().getInputsTablesView();
tablesView.addAll(mapperManager.getUiManager().getVarsTablesView());
tablesView.addAll(mapperManager.getUiManager().getOutputsTablesView());
if (forceRefreshData) {
mapperManager.getComponent().restoreMapperModelFromInternalData();
checkProblems();
}
for (DataMapTableView view : tablesView) {
checkProblemsForAllEntries(view, false);
}
}
use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView in project tdi-studio-se by Talend.
the class SearchZoneMapper method moveScrollBarZoneAtSelectedTableItem.
public void moveScrollBarZoneAtSelectedTableItem(ITableEntry entry) {
if (entry != null) {
DataMapTableView dataMapTableView = mapperManager.retrieveIDataMapTableView(entry.getParent());
Rectangle tableViewBounds = dataMapTableView.getBounds();
IDataMapTable table = entry.getParent();
TableItem tableItem = mapperManager.retrieveTableItem(entry);
if (table != null && tableItem != null) {
Rectangle tableItemBounds = tableItem.getBounds();
int selection = tableViewBounds.y + tableItemBounds.y;
ScrolledComposite scrollComposite = null;
if (table instanceof InputTable) {
scrollComposite = uiManager.getScrolledCompositeViewInputs();
} else if (table instanceof OutputTable) {
scrollComposite = uiManager.getScrolledCompositeViewOutputs();
}
if (scrollComposite != null) {
setPositionOfVerticalScrollBarZone(scrollComposite, selection);
}
}
}
}
use of org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView 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(OutputDataMapTableView dataMapTableViewToRemove) {
List<DataMapTableView> outputsTablesView = 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();
OutputTable outputTable = (OutputTable) dataMapTableViewToRemove.getDataMapTable();
if (outputMetaEditorView.getMetadataTableEditor().getMetadataTable() == outputTable.getMetadataTable()) {
getOutputMetaEditorView().setMetadataTableEditor(null);
}
dataMapTableViewToRemove.dispose();
dataMapTableViewToRemove = null;
getTablesZoneViewOutputs().layout();
refreshBackground(true, false);
setCurrentSelectedOutputTableView(null);
}
Aggregations