use of org.talend.sqlbuilder.dataset.dataset.DataSetTable in project tdi-studio-se by Talend.
the class AbstractDataSetTab method fillDetailComposite.
public final void fillDetailComposite(Composite composite) {
try {
pComposite = composite;
DataSet dataSet = getCachedDataSet();
if (dataSet == null) {
return;
}
// store for later use in dataset table
//$NON-NLS-1$
composite.setData("IDetailTab", this);
new DataSetTable(composite, dataSet, getStatusMessage(), false);
} catch (Exception e) {
//$NON-NLS-1$
SqlBuilderPlugin.log(Messages.getString("AbstractDataSetTab.logMessage1"), e);
// couldn't get results.. clean mess up
Control[] controls = composite.getChildren();
for (int i = 0; i < controls.length; i++) {
controls[i].dispose();
}
// and show error message
Label label = new Label(composite, SWT.FILL);
//$NON-NLS-1$ //$NON-NLS-2$
label.setText(Messages.getString("DatabaseDetailView.Tab.Unavailable") + " " + e.getMessage());
label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
//$NON-NLS-1$
SqlBuilderPlugin.log(Messages.getString("AbstractDataSetTab.logMessage2"), e);
}
}
use of org.talend.sqlbuilder.dataset.dataset.DataSetTable in project tdi-studio-se by Talend.
the class SQLExecution method displayResults.
/**
* Display SQL Results in result pane.
*/
protected void displayResults() {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
clearCanvas();
composite.setLayout(new GridLayout());
try {
int resultCount = sqlResult.getDataSet().getRows().length;
String statusMessage = //$NON-NLS-1$ //$NON-NLS-2$
Messages.getString("SQLResultsView.Time.Prefix") + " " + sqlResult.getExecutionTimeMillis() + //$NON-NLS-1$
" " + //$NON-NLS-1$
Messages.getString("SQLResultsView.Time.Postfix");
if (resultCount > 0) {
statusMessage = //$NON-NLS-1$
statusMessage + " " + Messages.getString("SQLResultsView.Count.Prefix") + " " + //$NON-NLS-1$ //$NON-NLS-2$
resultCount;
}
new DataSetTable(composite, sqlResult.getDataSet(), statusMessage, true);
//$NON-NLS-1$
composite.setData("parenttab", parentTab);
} catch (Exception e) {
// add message
String message = e.getMessage();
Label errorLabel = new Label(composite, SWT.FILL);
errorLabel.setText(message);
errorLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
//$NON-NLS-1$
SqlBuilderPlugin.log(Messages.getString("SQLExecution.logMessage1"), e);
}
composite.layout();
composite.redraw();
// reset to start message in case F5 will be used
//$NON-NLS-1$
setProgressMessage(Messages.getString("SQLResultsView.ConnectionWait"));
}
;
});
}
Aggregations