use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class BrokerStatusView method createBasicTable.
/**
* Create basic info table
*
* @param comp the parent composite
*
*/
private void createBasicTable(Composite comp) {
final Composite basicComposite = new Composite(comp, SWT.NONE);
GridData gdBasic = new GridData(SWT.FILL, SWT.NONE, false, false);
basicComposite.setLayoutData(gdBasic);
basicComposite.setLayout(new GridLayout());
basicTableViewer = new TableViewer(basicComposite, SWT.NO_SCROLL | SWT.BORDER);
Table basicTable = basicTableViewer.getTable();
basicTable.setHeaderVisible(true);
basicTable.setLinesVisible(true);
GridData tblBasic = new GridData(SWT.FILL, SWT.TOP, true, false);
tblBasic.heightHint = CommonUITool.getHeightHintOfTable(basicTable);
basicTable.setLayoutData(tblBasic);
TableLayout basicLayout = new TableLayout();
setBasicLayout(basicLayout);
basicTable.setLayout(basicLayout);
basicTable.setBackground(basicComposite.getBackground());
TableColumn tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscPid);
tblColumn.setToolTipText(Messages.tblBscPid);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscPort);
tblColumn.setToolTipText(Messages.tblBscPort);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscJobQueue);
tblColumn.setToolTipText(Messages.tblBscJobQueue);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscAutoAddAs);
tblColumn.setToolTipText(Messages.tblBscAutoAddAs);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscSqlLogMode);
tblColumn.setToolTipText(Messages.tblBscSqlLogMode);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscLongTranTime);
tblColumn.setToolTipText(Messages.tblBscLongTranTime);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscLongQueryTime);
tblColumn.setToolTipText(Messages.tblBscLongQueryTime);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscSessionTimeout);
tblColumn.setToolTipText(Messages.tblBscSessionTimeout);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscKeepConn);
tblColumn.setToolTipText(Messages.tblBscKeepConn);
tblColumn = new TableColumn(basicTable, SWT.CENTER);
tblColumn.setText(Messages.tblBscAccessMode);
tblColumn.setToolTipText(Messages.tblBscAccessMode);
basicTableViewer.setContentProvider(new BrokerBasicInfoContentProvider());
ServerInfo serverInfo = cubridNode.getServer().getServerInfo();
BrokerBasicInfoLabelProvider basicInfoLabelProvider = new BrokerBasicInfoLabelProvider();
basicInfoLabelProvider.setServerInfo(serverInfo);
basicTableViewer.setLabelProvider(basicInfoLabelProvider);
basicTableViewer.setInput(basicInfoLst);
}
use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class BackupDatabaseDialog method createBackupHistoryComp.
/**
*
* Create backup history information tab composite
*
* @return the composite
*/
private Composite createBackupHistoryComp() {
Composite composite = new Composite(tabFolder, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
composite.setLayout(layout);
Label tipLabel = new Label(composite, SWT.LEFT | SWT.WRAP);
tipLabel.setText(Messages.msgBackupHistoryList);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
tipLabel.setLayoutData(gridData);
final String[] columnNameArr = new String[] { Messages.tblColumnBackupLevel, Messages.tblColumnBackupDate, Messages.tblColumnSize, Messages.tblColumnBackupPath };
TableViewer historyTableViewer = CommonUITool.createCommonTableViewer(composite, new TableViewerSorter(), columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, 400, 200));
historyTableViewer.setInput(getBackupHistoryInfoList());
Table historyTable = historyTableViewer.getTable();
for (int i = 0; i < historyTable.getColumnCount(); i++) {
historyTable.getColumn(i).pack();
}
return composite;
}
use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class ParamDumpResultDialog method createDialogArea.
/**
* @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
* @param parent The parent composite to contain the dialog area
* @return the dialog area control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(parentComp, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
layout.numColumns = 5;
composite.setLayout(layout);
//dynamicHelp end
createdbNameGroup(composite);
table = new Table(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
table.setHeaderVisible(true);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
gridData.horizontalSpan = 7;
gridData.verticalSpan = 10;
gridData.heightHint = 300;
table.setLayoutData(gridData);
table.setLinesVisible(true);
CommonUITool.hackForYosemite(table);
/*
* // fill in context menu
*/
Menu menu = new Menu(parent.getShell(), SWT.POP_UP);
table.setMenu(menu);
MenuItem copy = new MenuItem(menu, SWT.PUSH);
copy.setText(Messages.bind(com.cubrid.cubridmanager.ui.logs.Messages.contextCopy, "Ctrl+C"));
copy.setAccelerator(SWT.CTRL + 'C');
copy.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
TextTransfer textTransfer = TextTransfer.getInstance();
Clipboard clipboard = CommonUITool.getClipboard();
StringBuilder content = new StringBuilder();
TableItem[] items = table.getSelection();
for (int i = 0; i < items.length; i++) {
content.append(items[i].getText(0) + blank + items[i].getText(1) + blank + items[i].getText(2) + blank + System.getProperty("line.separator"));
}
String data = content.toString();
if (data != null && !data.equals("")) {
clipboard.setContents(new Object[] { data }, new Transfer[] { textTransfer });
}
}
});
table.addKeyListener(new org.eclipse.swt.events.KeyAdapter() {
public void keyPressed(org.eclipse.swt.events.KeyEvent event) {
if ((event.stateMask & SWT.CTRL) != 0 && (event.stateMask & SWT.SHIFT) == 0 && event.keyCode == 'c') {
TextTransfer textTransfer = TextTransfer.getInstance();
Clipboard clipboard = CommonUITool.getClipboard();
StringBuilder content = new StringBuilder();
TableItem[] items = table.getSelection();
for (int i = 0; i < items.length; i++) {
content.append(items[i].getText(0) + blank + items[i].getText(1) + blank + items[i].getText(2) + blank + System.getProperty("line.separator"));
}
String data = content.toString();
if (data != null && !data.equals("")) {
clipboard.setContents(new Object[] { data }, new Transfer[] { textTransfer });
}
}
}
});
setTitle(Messages.titleParamDumpDialog);
setMessage(Messages.msgParamDumpDialog);
initial();
return parentComp;
}
use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class NewDirectoryDialog method createDirectoryList.
/**
* create the directory list
*
* @param composite the parent composite
*/
private void createDirectoryList(Composite composite) {
directoryList = new Table(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION);
directoryList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
directoryList.setLinesVisible(true);
directoryList.setHeaderVisible(true);
directoryList.setEnabled(false);
TableLayout tableLayout = new TableLayout();
tableLayout.addColumnData(new ColumnWeightData(20, true));
directoryList.setLayout(tableLayout);
final TableColumn currentVolumeColumn = new TableColumn(directoryList, SWT.LEFT);
currentVolumeColumn.setText(Messages.tblColDirectoryVolume);
currentVolumeColumn.pack();
}
use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.
the class OptimizeDialog method createDialogArea.
/**
* Create dialog area content
*
* @param parent the parent composite
* @return the control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
final Composite composite = new Composite(parentComp, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.marginWidth = 10;
layout.marginHeight = 10;
composite.setLayout(layout);
final Group dbNameGroup = new Group(composite, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 10;
layout.marginHeight = 10;
dbNameGroup.setLayout(layout);
final GridData gdDbNameGroup = new GridData(GridData.FILL_HORIZONTAL);
dbNameGroup.setLayoutData(gdDbNameGroup);
final Label dbNameLabel = new Label(dbNameGroup, SWT.LEFT | SWT.WRAP);
dbNameLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
dbNameLabel.setText(Messages.lblOptimizeDbName);
databaseName = new Text(dbNameGroup, SWT.BORDER);
databaseName.setEnabled(false);
final GridData gdDatabaseName = new GridData(SWT.FILL, SWT.FILL, true, false);
databaseName.setLayoutData(gdDatabaseName);
final Label optimizeLabel = new Label(dbNameGroup, SWT.WRAP);
optimizeLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
optimizeLabel.setText(Messages.lblOptimizeClassName);
GridData gdClassName = new org.eclipse.swt.layout.GridData(SWT.FILL, SWT.FILL, true, false);
className = new Combo(dbNameGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
className.setLayoutData(gdClassName);
className.setVisibleItemCount(15);
final Group descGroup = new Group(composite, SWT.NONE);
layout = new GridLayout();
layout.marginWidth = 10;
layout.marginHeight = 10;
descGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
descGroup.setLayout(layout);
descGroup.setText(Messages.grpOptimizeDesc);
final Label descriptionLabel = new Label(descGroup, SWT.WRAP);
descriptionLabel.setText(Messages.lblOptimizeDesc);
descriptionLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
volumeTable = new Table(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.READ_ONLY);
volumeTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
volumeTable.setLinesVisible(false);
volumeTable.setHeaderVisible(false);
TableLayout tableLayout = new TableLayout();
volumeTable.setLayout(tableLayout);
final TableColumn currentVolumeColumn = new TableColumn(volumeTable, SWT.LEFT);
currentVolumeColumn.setText("");
currentVolumeColumn.pack();
setMessage(Messages.msgOptimizeDbInformation);
setTitle(Messages.titleOptimizeDbDialog);
initial();
return parentComp;
}
Aggregations