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();
}
}
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);
}
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);
}
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);
}
});
}
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));
}
}
}
Aggregations