Search in sources :

Example 26 with TableViewerSorter

use of com.cubrid.common.ui.spi.TableViewerSorter in project cubrid-manager by CUBRID.

the class OverrideFileDialog method createFileTableComp.

/**
	 * 
	 * Create directory table
	 * 
	 * @param parent the parent composite
	 */
private void createFileTableComp(Composite parent) {
    Composite comp = new Composite(parent, SWT.NONE);
    GridData gridData = new GridData(GridData.FILL_BOTH);
    comp.setLayoutData(gridData);
    GridLayout layout = new GridLayout();
    comp.setLayout(layout);
    Label tipLabel = new Label(comp, SWT.NONE);
    tipLabel.setText(Messages.msgOverrideFileList);
    tipLabel.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
    final String[] columnNameArr = new String[] { Messages.tblColumnFile };
    TableViewer tableViewer = CommonUITool.createCommonTableViewer(comp, new TableViewerSorter(), columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 4, -1, 200));
    Table dirTable = tableViewer.getTable();
    tableViewer.setInput(getTableModel());
    for (int i = 0; i < dirTable.getColumnCount(); i++) {
        dirTable.getColumn(i).pack();
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) TableViewerSorter(com.cubrid.common.ui.spi.TableViewerSorter) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 27 with TableViewerSorter

use of com.cubrid.common.ui.spi.TableViewerSorter in project cubrid-manager by CUBRID.

the class LockInfoDetailDialog method createLockWaitersLabel.

/**
	 * 
	 * Create lock waiters label
	 * 
	 * @param composite the parent composite
	 */
private void createLockWaitersLabel(Composite composite) {
    final Group lockWaitersGroup = new Group(composite, SWT.NONE);
    lockWaitersGroup.setText(Messages.grpLockWaiter);
    lockWaitersGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    lockWaitersGroup.setLayout(layout);
    final String[] columnNameArr = new String[] { Messages.tblColWaiterTranIndex, Messages.tblColWaiterBlockedMode, Messages.tblColWaiterStartWaitingAt, Messages.tblColWaiterWaitForNsecs };
    lockWaiterTableViewer = CommonUITool.createCommonTableViewer(lockWaitersGroup, new TableViewerSorter(), columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, 200));
    lockWaiterTable = lockWaiterTableViewer.getTable();
    lockWaiterTableViewer.setInput(lockWaiterListData);
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) TableViewerSorter(com.cubrid.common.ui.spi.TableViewerSorter) GridData(org.eclipse.swt.layout.GridData)

Example 28 with TableViewerSorter

use of com.cubrid.common.ui.spi.TableViewerSorter in project cubrid-manager by CUBRID.

the class LockInfoDetailDialog method createLockHoldersGroup.

/**
	 * 
	 * Create the lock holders group
	 * 
	 * @param composite the parent composite
	 */
private void createLockHoldersGroup(Composite composite) {
    final Group lockHoldersGroup = new Group(composite, SWT.NONE);
    lockHoldersGroup.setText(Messages.grpLockHolders);
    lockHoldersGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout(1, true);
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    lockHoldersGroup.setLayout(layout);
    final String[] columnNameArr = new String[] { Messages.tblColTranIndex, Messages.tblColGrantedMode, Messages.tblColCount, Messages.tblColNsubgranules };
    lockHolderTableViewer = CommonUITool.createCommonTableViewer(lockHoldersGroup, new TableViewerSorter(), columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, 200));
    lockHolderTable = lockHolderTableViewer.getTable();
    lockHolderTableViewer.setInput(lockHolderListData);
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) TableViewerSorter(com.cubrid.common.ui.spi.TableViewerSorter) GridData(org.eclipse.swt.layout.GridData)

Example 29 with TableViewerSorter

use of com.cubrid.common.ui.spi.TableViewerSorter in project cubrid-manager by CUBRID.

the class SelectTableComp method createTableGroup.

/**
	 * 
	 * Create the group of select tables
	 * 
	 * @param parent Composite
	 */
public void createTableGroup(Composite parent) {
    Group replTableInfoGroup = new Group(parent, SWT.NONE);
    replTableInfoGroup.setText(Messages.chsldb2grpSelectTablesPage);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    replTableInfoGroup.setLayoutData(gridData);
    GridLayout layout = new GridLayout();
    replTableInfoGroup.setLayout(layout);
    allTableBtn = new Button(replTableInfoGroup, SWT.CHECK);
    allTableBtn.setText(Messages.btnSelectAllTables);
    allTableBtn.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
    allTableBtn.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            if (allTableBtn.getSelection()) {
                for (int i = 0; i < selectClassesTable.getItemCount(); i++) {
                    selectClassesTable.getItem(i).setChecked(true);
                }
            } else {
                for (int i = 0; i < selectClassesTable.getItemCount(); i++) {
                    selectClassesTable.getItem(i).setChecked(false);
                }
            }
        }
    });
    String[] columnNameArr = new String[] { Messages.tblColTableName };
    tableViewer = (CheckboxTableViewer) CommonUITool.createCheckBoxTableViewer(replTableInfoGroup, new TableViewerSorter(), columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, 150));
    selectClassesTable = tableViewer.getTable();
    tableViewer.addCheckStateListener(new ICheckStateListener() {

        public void checkStateChanged(CheckStateChangedEvent event) {
            allTableBtn.setSelection(false);
        }
    });
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) TableViewerSorter(com.cubrid.common.ui.spi.TableViewerSorter) Button(org.eclipse.swt.widgets.Button) ICheckStateListener(org.eclipse.jface.viewers.ICheckStateListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) CheckStateChangedEvent(org.eclipse.jface.viewers.CheckStateChangedEvent)

Example 30 with TableViewerSorter

use of com.cubrid.common.ui.spi.TableViewerSorter in project cubrid-manager by CUBRID.

the class AutoAddVolumeLogDialog method createLogsHoldersGroup.

/**
	 * Creates the Lock holders group
	 * 
	 * @param composite Composite
	 */
private void createLogsHoldersGroup(Composite composite) {
    final Group logsHolderGroup = new Group(composite, SWT.NONE);
    logsHolderGroup.setText(LOGS_HOLDERS_GROUP_NAME);
    logsHolderGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout(1, true);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    logsHolderGroup.setLayout(layout);
    final String[] columnNameArr = new String[] { DATABASE, VOLUME_NAME, PURPOSE, NUM_PAGES, TIME, STATUS };
    tableViewer = CommonUITool.createCommonTableViewer(logsHolderGroup, new TableViewerSorter(), columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, 200));
    volumeLogsTable = tableViewer.getTable();
    initialTableModel();
    tableViewer.setInput(logsInfoTableList);
    for (int i = 0; i < volumeLogsTable.getColumnCount(); i++) {
        volumeLogsTable.getColumn(i).pack();
    }
    /* TOOLS-3216 Display the error log with red color */
    for (int i = 0; i < volumeLogsTable.getItemCount(); i++) {
        String logDesc = (String) logsInfoTableList.get(i).get("5");
        String startDesc = "start";
        String sucDesc = "success";
        if (!startDesc.equals(logDesc) && !sucDesc.equals(logDesc)) {
            volumeLogsTable.getItem(i + 1).setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
        }
    }
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) TableViewerSorter(com.cubrid.common.ui.spi.TableViewerSorter) GridData(org.eclipse.swt.layout.GridData)

Aggregations

TableViewerSorter (com.cubrid.common.ui.spi.TableViewerSorter)30 GridData (org.eclipse.swt.layout.GridData)20 GridLayout (org.eclipse.swt.layout.GridLayout)19 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)12 SelectionEvent (org.eclipse.swt.events.SelectionEvent)12 Label (org.eclipse.swt.widgets.Label)12 TableViewer (org.eclipse.jface.viewers.TableViewer)11 Composite (org.eclipse.swt.widgets.Composite)11 Group (org.eclipse.swt.widgets.Group)10 TableContentProvider (com.cubrid.common.ui.spi.TableContentProvider)7 TableColumn (org.eclipse.swt.widgets.TableColumn)7 HashMap (java.util.HashMap)6 Map (java.util.Map)6 Button (org.eclipse.swt.widgets.Button)5 TableLabelProvider (com.cubrid.common.ui.spi.TableLabelProvider)4 Table (org.eclipse.swt.widgets.Table)4 CellEditor (org.eclipse.jface.viewers.CellEditor)3 CLabel (org.eclipse.swt.custom.CLabel)3 Point (org.eclipse.swt.graphics.Point)3 CheckStateChangedEvent (org.eclipse.jface.viewers.CheckStateChangedEvent)2