use of org.talend.designer.dbmap.ui.visualmap.table.OutputDataMapTableView in project tdi-studio-se by Talend.
the class UIManager method refreshSqlExpression.
/**
* Refresh Sql select query in the bottom tab and its title.
*/
public void refreshSqlExpression() {
if (getTabFolderEditors().getSelectionIndex() == 2) {
mapperManager.getComponent().restoreMapperModelFromInternalData();
OutputDataMapTableView selectedOutputTableView = getCurrentSelectedOutputTableView();
if (selectedOutputTableView == null) {
} else {
IDataMapTable dataMapTable = selectedOutputTableView.getDataMapTable();
String tableName = dataMapTable.getName();
DbGenerationManager generationMnager = mapperManager.getComponent().getGenerationManager();
String sql = generationMnager.buildSqlSelect(mapperManager.getComponent(), tableName);
getTabFolderEditors().getItem(2).setText(//$NON-NLS-1$
Messages.getString("TabFolderEditors.SqlSelectQuery", new Object[] { tableName }));
getTabFolderEditors().getStyledSqlText().setText(sql);
}
}
}
Aggregations