Search in sources :

Example 76 with TableColumn

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]);
    }
}
Also used : TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 77 with TableColumn

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);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) AnalyzeCasLogResultInfo(com.cubrid.cubridmanager.core.logs.model.AnalyzeCasLogResultInfo) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 78 with TableColumn

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;
}
Also used : TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 79 with TableColumn

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);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) AnalyzeCasLogResultInfo(com.cubrid.cubridmanager.core.logs.model.AnalyzeCasLogResultInfo) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 80 with TableColumn

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;
}
Also used : TableColumn(org.eclipse.swt.widgets.TableColumn)

Aggregations

TableColumn (org.eclipse.swt.widgets.TableColumn)305 Table (org.eclipse.swt.widgets.Table)151 GridData (org.eclipse.swt.layout.GridData)105 TableViewer (org.eclipse.jface.viewers.TableViewer)94 Composite (org.eclipse.swt.widgets.Composite)92 SelectionEvent (org.eclipse.swt.events.SelectionEvent)87 GridLayout (org.eclipse.swt.layout.GridLayout)76 TableItem (org.eclipse.swt.widgets.TableItem)76 Point (org.eclipse.swt.graphics.Point)57 Label (org.eclipse.swt.widgets.Label)55 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)52 Button (org.eclipse.swt.widgets.Button)48 TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)41 FillLayout (org.eclipse.swt.layout.FillLayout)37 Listener (org.eclipse.swt.widgets.Listener)37 Event (org.eclipse.swt.widgets.Event)35 Shell (org.eclipse.swt.widgets.Shell)35 Test (org.junit.Test)33 SelectionListener (org.eclipse.swt.events.SelectionListener)32 Text (org.eclipse.swt.widgets.Text)30