use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class LogEditorPart method createTableColumn.
/**
*
* Create the table column
*
* @param columnNames String[]
* @param widths int[]
* @param aligns int[]
*/
private void createTableColumn(String[] columnNames, int[] widths, int[] aligns) {
for (int i = 0; i < columnNames.length; i++) {
TableColumn tblColumn = new TableColumn(table, aligns[i]);
tblColumn.setText(columnNames[i]);
tblColumn.setWidth(widths[i]);
}
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class SqlLogAnalyzeResultDialog method createAnalyzeResultTableOptionY.
/**
* This method initializes table when option is yes
*
* @param tlayout TableLayout
*/
private void createAnalyzeResultTableOptionY(TableLayout tlayout) {
tlayout.addColumnData(new ColumnWeightData(20, 60, true));
tlayout.addColumnData(new ColumnWeightData(20, 60, true));
table.setLayout(tlayout);
table.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
if (analyzeCasLogResultList == null || analyzeCasLogResultList.getLogFileInfoList() == null) {
return;
}
int selectioncount = table.getSelectionCount();
int resultCount = analyzeCasLogResultList.getLogFileInfoList().size();
StringBuilder queryString = new StringBuilder();
AnalyzeCasLogResultInfo logResult;
for (int j = 0; j < selectioncount; j++) {
String qindex = table.getSelection()[j].getText(0);
for (int i = 0; i < resultCount; i++) {
logResult = (AnalyzeCasLogResultInfo) (analyzeCasLogResultList.getLogFileInfoList().get(i));
if (qindex.equals(logResult.getQindex())) {
currentResultIndex = i;
queryString = connect(logResult.getQindex(), queryString);
queryString.append(logResult.getQueryString());
queryString.append(NEXT_LINE);
buttonRunOriginalQuery.setEnabled(true);
buttonSaveToFile.setEnabled(true);
break;
}
}
}
textQuery.setText(queryString.toString());
}
});
TableColumn qindex = new TableColumn(table, SWT.LEFT);
qindex.addSelectionListener(new DirectionAwareSelectionAdapter("qindex"));
qindex.setText(Messages.tableIndex);
qindex.setWidth(100);
TableColumn execTime = new TableColumn(table, SWT.LEFT);
execTime.addSelectionListener(new DirectionAwareSelectionAdapter("execTime"));
execTime.setText(Messages.tableTransactionExeTime);
execTime.setWidth(100);
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class SqlLogAnalyzeResultDialog method makeCntColumn.
/**
* make cnt table column
*
* @return tableColumn
*/
private TableColumn makeCntColumn() {
TableColumn cnt = new TableColumn(table, SWT.LEFT);
cnt.addSelectionListener(new DirectionAwareSelectionAdapter("cnt"));
return cnt;
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class SqlLogAnalyzeResultDialog method createAnalyzeResultTableOptionN.
/**
* This method initializes table when option is no
*
* @param tlayout TableLayout
*/
private void createAnalyzeResultTableOptionN(TableLayout tlayout) {
tlayout.addColumnData(new ColumnWeightData(13, 60, true));
tlayout.addColumnData(new ColumnWeightData(14, 60, true));
tlayout.addColumnData(new ColumnWeightData(14, 60, true));
tlayout.addColumnData(new ColumnWeightData(14, 60, true));
tlayout.addColumnData(new ColumnWeightData(20, 60, true));
tlayout.addColumnData(new ColumnWeightData(20, 60, true));
table.setLayout(tlayout);
table.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
if (analyzeCasLogResultList == null || analyzeCasLogResultList.getLogFileInfoList() == null) {
return;
}
int selectioncount = table.getSelectionCount();
int resultCount = analyzeCasLogResultList.getLogFileInfoList().size();
StringBuilder queryString = new StringBuilder();
AnalyzeCasLogResultInfo logResult;
for (int j = 0; j < selectioncount; j++) {
String qindex = table.getSelection()[j].getText(0);
for (int i = 0; i < resultCount; i++) {
logResult = (AnalyzeCasLogResultInfo) (analyzeCasLogResultList.getLogFileInfoList().get(i));
if (qindex.equals(logResult.getQindex())) {
currentResultIndex = i;
queryString = connect(logResult.getQindex(), queryString);
queryString.append(logResult.getQueryString());
queryString.append(NEXT_LINE);
buttonRunOriginalQuery.setEnabled(true);
buttonSaveToFile.setEnabled(true);
break;
}
}
}
textQuery.setText(queryString.toString());
}
});
TableColumn qindex = makeQindexColumn();
TableColumn max = makeMaxColumn();
TableColumn min = makeMinColumn();
TableColumn avg = makeAvgColumn();
TableColumn cnt = makeCntColumn();
TableColumn err = makeErrColumn();
qindex.setText(Messages.tableIndex);
max.setText(Messages.tableMax);
max.setAlignment(SWT.RIGHT);
min.setText(Messages.tableMin);
min.setAlignment(SWT.RIGHT);
avg.setText(Messages.tableAvg);
avg.setAlignment(SWT.RIGHT);
cnt.setText(Messages.tableTotalCount);
cnt.setAlignment(SWT.RIGHT);
err.setText(Messages.tableErrCount);
err.setAlignment(SWT.RIGHT);
qindex.setWidth(60);
max.setWidth(60);
min.setWidth(60);
avg.setWidth(60);
cnt.setWidth(50);
err.setWidth(50);
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class SqlLogAnalyzeResultDialog method makeMinColumn.
/**
* make min table column
*
* @return tableColumn
*/
private TableColumn makeMinColumn() {
TableColumn min = new TableColumn(table, SWT.LEFT);
min.addSelectionListener(new DirectionAwareSelectionAdapter("min"));
return min;
}
Aggregations