use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class ObjectInfoComposite method initIndexTabItem.
/**
* Initial index tab index
*
*/
private void initIndexTabItem() {
CubridDatabase database = schemaNode.getDatabase();
CTabItem indexTabItem = new CTabItem(objInfoFolder, SWT.NONE);
indexTabItem.setText(Messages.titleIndex);
indexTabItem.setShowClose(false);
Composite composite = new Composite(objInfoFolder, SWT.None);
indexTabItem.setControl(composite);
composite.setLayout(new FillLayout());
final SashForm sashForm = new SashForm(composite, SWT.VERTICAL);
sashForm.setBackground(CombinedQueryEditorComposite.BACK_COLOR);
/*Index table composite*/
Composite indexComposite = new Composite(sashForm, SWT.None);
indexComposite.setLayout(new GridLayout());
/*FK table composite*/
Composite fkComposite = new Composite(sashForm, SWT.None);
fkComposite.setLayout(new GridLayout());
/*Set the sashform*/
sashForm.setWeights(new int[] { 1, 1 });
// create index table view
final Label indexLabel = new Label(indexComposite, SWT.NONE);
indexLabel.setText(Messages.lblIndexes);
indexTableViewer = new TableViewer(indexComposite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
Table indexTable = indexTableViewer.getTable();
indexTable.setLinesVisible(true);
indexTable.setHeaderVisible(true);
indexTable.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
TableColumn tblCol = new TableColumn(indexTable, SWT.NONE);
tblCol.setWidth(150);
tblCol.setText(Messages.tblColumnIndexName);
TableColumn indexNameColumn = new TableColumn(indexTable, SWT.NONE);
indexNameColumn.setWidth(78);
indexNameColumn.setText(Messages.tblColumnIndexType);
TableColumn indexTypeColumn = new TableColumn(indexTable, SWT.NONE);
indexTypeColumn.setWidth(218);
indexTypeColumn.setText(Messages.tblColumnOnColumns);
TableColumn ruleColumn = new TableColumn(indexTable, SWT.NONE);
ruleColumn.setWidth(282);
ruleColumn.setText(Messages.tblColumnIndexRule);
IndexTableViewerContentProvider indexContentProvider = new IndexTableViewerContentProvider();
IndexTableViewerLabelProvider indexLabelProvider = new IndexTableViewerLabelProvider();
indexTableViewer.setContentProvider(indexContentProvider);
indexTableViewer.setLabelProvider(indexLabelProvider);
// create the fk table viewer
final Label fkLabel = new Label(fkComposite, SWT.NONE);
fkLabel.setText(Messages.lblFK);
fkTableViewer = new TableViewer(fkComposite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
Table fkTable = fkTableViewer.getTable();
fkTable.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
fkTable.setLinesVisible(true);
fkTable.setHeaderVisible(true);
TableColumn fkNameColumn = new TableColumn(fkTable, SWT.NONE);
fkNameColumn.setWidth(100);
fkNameColumn.setText(Messages.tblColumnFK);
TableColumn fkColumnName = new TableColumn(fkTable, SWT.NONE);
fkColumnName.setWidth(119);
fkColumnName.setText(Messages.tblColumnColumnName);
TableColumn fTableColumn = new TableColumn(fkTable, SWT.NONE);
fTableColumn.setWidth(93);
fTableColumn.setText(Messages.tblColumnForeignTable);
TableColumn fkColumnNameColumn = new TableColumn(fkTable, SWT.NONE);
fkColumnNameColumn.setWidth(143);
fkColumnNameColumn.setText(Messages.tblColumnForeignColumnName);
TableColumn updateRuletblColumn = new TableColumn(fkTable, SWT.NONE);
updateRuletblColumn.setWidth(84);
updateRuletblColumn.setText(Messages.tblColumnUpdateRule);
TableColumn deleteRuleColumn = new TableColumn(fkTable, SWT.NONE);
deleteRuleColumn.setWidth(86);
deleteRuleColumn.setText(Messages.tblColumnDeleteRule);
TableColumn cacheColumn = new TableColumn(fkTable, SWT.NONE);
cacheColumn.setWidth(100);
cacheColumn.setText(Messages.tblColumnCacheColumn);
fkTableViewer.setContentProvider(new FKTableViewerContentProvider());
fkTableViewer.setLabelProvider(new FKTableViewerLabelProvider(database.getDatabaseInfo()));
}
use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class TableFocusCellManager method getFocusCell.
/**
*
* Get the focus cell
*
* @return ViewerCell
*/
public ViewerCell getFocusCell() {
ViewerCell cell = this.focusCell;
Table t = (Table) getViewer().getControl();
// It is possible that the selection has changed under the hood
if (cell != null) {
if (t.getSelection().length == 1 && t.getSelection()[0] != cell.getItem()) {
setFocusCell(getViewer().getViewerRowByItem(t.getSelection()[0]).getCell(cell.getColumnIndex()));
}
}
return this.focusCell;
}
use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class TableFocusCellManager method getInitialFocusCell.
/**
*
* Get the initial focus cell
*
* @return ViewerCell
*/
public ViewerCell getInitialFocusCell() {
Table table = (Table) getViewer().getControl();
if (!table.isDisposed() && table.getItemCount() > 0 && !table.getItem(table.getTopIndex()).isDisposed()) {
final ViewerRow aViewerRow = getViewer().getViewerRowByItem(table.getItem(table.getTopIndex()));
if (table.getColumnCount() == 0) {
return aViewerRow.getCell(0);
}
Rectangle clientArea = table.getClientArea();
for (int i = 0; i < table.getColumnCount(); i++) {
if (aViewerRow.getBounds(i).width > 0 && columnInVisibleArea(clientArea, aViewerRow, i))
return aViewerRow.getCell(i);
}
}
return null;
}
use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class BrokersParameterPropertyPage method createBrokerLstComp.
/**
* Creates brokers list Composite
*
* @param parent the parent composite
* @return the composite
*/
private Control createBrokerLstComp(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
createBasicGroup(composite);
Group brokerLstGroup = new Group(composite, SWT.NONE);
brokerLstGroup.setText(BROKER_LIST);
brokerLstGroup.setLayout(new GridLayout(2, false));
brokerLstGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
String[] columnNameArrs = new String[] { nameOfBrokerLst, portOfBrokerLst };
brokersTableViewer = CommonUITool.createCommonTableViewer(brokerLstGroup, null, columnNameArrs, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, 200));
Table brokersTable = brokersTableViewer.getTable();
TableLayout tlayout = new TableLayout();
tlayout.addColumnData(new ColumnWeightData(120, 100, true));
tlayout.addColumnData(new ColumnWeightData(120, 100, true));
brokersTable.setLayout(tlayout);
createDealButton(brokerLstGroup);
return composite;
}
use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class DataCompareEditorPart method checkUncheckItems.
private void checkUncheckItems(TableViewer tableViewer, boolean check) {
Table table = tableViewer.getTable();
int selectionCount = table.getSelectionCount();
if (selectionCount > 1) {
TableItem[] items = table.getSelection();
for (TableItem item : items) {
DataCompare dataCompare = (DataCompare) item.getData();
dataCompare.setUse(check);
}
}
tableViewer.refresh();
}
Aggregations