Search in sources :

Example 6 with OutputDataMapTableView

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);
        }
    }
}
Also used : DbGenerationManager(org.talend.designer.dbmap.language.generation.DbGenerationManager) IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) OutputDataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.OutputDataMapTableView)

Aggregations

OutputDataMapTableView (org.talend.designer.dbmap.ui.visualmap.table.OutputDataMapTableView)6 IDataMapTable (org.talend.designer.abstractmap.model.table.IDataMapTable)3 OutputTable (org.talend.designer.dbmap.model.table.OutputTable)3 Point (org.eclipse.swt.graphics.Point)2 FormAttachment (org.eclipse.swt.layout.FormAttachment)2 FormData (org.eclipse.swt.layout.FormData)2 Control (org.eclipse.swt.widgets.Control)2 AbstractMetadataTableEditorView (org.talend.core.ui.metadata.editor.AbstractMetadataTableEditorView)2 MetadataTableEditorView (org.talend.core.ui.metadata.editor.MetadataTableEditorView)2 DataMapTableView (org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView)2 InputDataMapTableView (org.talend.designer.dbmap.ui.visualmap.table.InputDataMapTableView)2 OutputsZone (org.talend.designer.dbmap.ui.visualmap.zone.OutputsZone)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 ControlEvent (org.eclipse.swt.events.ControlEvent)1 ControlListener (org.eclipse.swt.events.ControlListener)1 GridData (org.eclipse.swt.layout.GridData)1 TableViewerCreator (org.talend.commons.ui.swt.tableviewer.TableViewerCreator)1