use of com.cubrid.common.ui.cubrid.table.control.PartitionTableLabelProvider in project cubrid-manager by CUBRID.
the class TableEditorPart method createPartitionTabItem.
private void createPartitionTabItem(final TabFolder tabFolder) {
loadPartitionInfoList();
final TabItem partTabItem = new TabItem(tabFolder, SWT.NONE);
final Composite parentComp = new Composite(tabFolder, SWT.NONE);
{
GridLayout gd = new GridLayout();
parentComp.setLayout(gd);
}
partTabItem.setControl(parentComp);
partTabItem.setText(Messages.tabItemPartition);
partitionTableView = new TableViewer(parentComp, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
final Table partitionTable = partitionTableView.getTable();
{
partitionTable.setLayout(TableViewUtil.createTableViewLayout(new int[] { 20, 15, 10, 20, 25, 10 }));
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 350;
partitionTable.setLayoutData(gd);
}
partitionTable.setHeaderVisible(true);
partitionTable.setLinesVisible(true);
CommonUITool.hackForYosemite(partitionTable);
TableViewUtil.createTableColumn(partitionTable, SWT.CENTER, Messages.tblColTableName);
TableViewUtil.createTableColumn(partitionTable, SWT.CENTER, Messages.tblColPartitionName);
TableViewUtil.createTableColumn(partitionTable, SWT.CENTER, Messages.tblColType);
TableViewUtil.createTableColumn(partitionTable, SWT.CENTER, Messages.tblColExpr);
TableViewUtil.createTableColumn(partitionTable, SWT.CENTER, Messages.tblColExprValue);
TableViewUtil.createTableColumn(partitionTable, SWT.CENTER, Messages.tblColRows);
partitionTableView.setLabelProvider(new PartitionTableLabelProvider());
partitionTableView.setContentProvider(new PartitionContentProvider());
partitionTableView.setInput(partitionInfoList);
partitionTableView.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
editPartition();
}
});
tabFolder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
if (tabFolder.getSelection()[0].getText().equals(Messages.tabItemPartition)) {
partitionTableView.refresh();
}
}
});
createPartitionTabButtons(parentComp);
}
Aggregations