use of org.eclipse.jface.viewers.TableViewer in project cubrid-manager by CUBRID.
the class MultiHostConnectionDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
Composite newComp = new Composite(parentComp, SWT.NONE);
GridData data = new GridData(GridData.FILL_BOTH);
setTitle(Messages.titleConnectionProgress);
setMessage(Messages.msgClickToConnect, IMessageProvider.INFORMATION);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
newComp.setLayout(layout);
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
newComp.setLayoutData(data);
viewer = new TableViewer(newComp, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
final GridData gdColumnsTable = new GridData(SWT.FILL, SWT.FILL, true, true);
table = viewer.getTable();
table.setLayoutData(gdColumnsTable);
table.setHeaderVisible(true);
table.setLinesVisible(true);
{
TableColumn icons = new TableColumn(table, SWT.CENTER, 0);
icons.setText("");
icons.setWidth(20);
TableColumn taskName = new TableColumn(table, SWT.CENTER, 1);
taskName.setText(Messages.colTaskName);
taskName.setWidth(150);
TableColumn taskProgress = new TableColumn(table, SWT.CENTER, 2);
taskProgress.setText(Messages.colTaskProgress);
taskProgress.setWidth(300);
TableColumn details = new TableColumn(table, SWT.CENTER, 3);
details.setText(Messages.colTaskDetails);
details.setWidth(300);
}
initTask();
Control control = super.createDialogArea(parent);
return control;
}
use of org.eclipse.jface.viewers.TableViewer in project cubrid-manager by CUBRID.
the class MultiHostEditDialog method createDialogArea.
protected Control createDialogArea(Composite parent) {
getShell().setText(Messages.multiEditServerDialogTitle);
Composite parentComp = (Composite) super.createDialogArea(parent);
setTitle(Messages.multiEditServerDialogTitle);
setMessage(Messages.multiEditServerDialogMessages);
serverTable = new TableViewer(parentComp, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
serverTable.getTable().setLayoutData(gridData);
serverTable.getTable().setHeaderVisible(true);
serverTable.getTable().setLinesVisible(true);
@SuppressWarnings("all") final TableViewerColumn //emty column can make image not take no use place at first column
empty = new TableViewerColumn(serverTable, SWT.NONE);
final TableViewerColumn columnName = new TableViewerColumn(serverTable, SWT.NONE);
columnName.getColumn().setWidth(130);
columnName.getColumn().setText(Messages.multiEditServerDialogColumnName);
columnName.setEditingSupport(new HostEditingSupport(0, serverTable));
final TableViewerColumn columnHost = new TableViewerColumn(serverTable, SWT.NONE);
columnHost.getColumn().setWidth(100);
columnHost.getColumn().setText(Messages.multiConnectServerDialogColumnHostAddress);
columnHost.setEditingSupport(new HostEditingSupport(1, serverTable));
final TableViewerColumn columnPort = new TableViewerColumn(serverTable, SWT.NONE);
columnPort.getColumn().setWidth(50);
columnPort.getColumn().setText(Messages.multiEditServerDialogColumnPort);
columnPort.setEditingSupport(new HostEditingSupport(2, serverTable));
final TableViewerColumn columnDriver = new TableViewerColumn(serverTable, SWT.NONE);
columnDriver.getColumn().setWidth(160);
columnDriver.getColumn().setText(Messages.multiEditServerDialogColumnDriver);
columnDriver.setEditingSupport(new HostEditingSupport(3, serverTable));
final TableViewerColumn columnUser = new TableViewerColumn(serverTable, SWT.NONE);
columnUser.getColumn().setWidth(80);
columnUser.getColumn().setText(Messages.multiConnectServerDialogColumnUser);
columnUser.setEditingSupport(new HostEditingSupport(4, serverTable));
final TableViewerColumn columnPassword = new TableViewerColumn(serverTable, SWT.NONE);
columnPassword.getColumn().setWidth(70);
columnPassword.getColumn().setText(Messages.multiEditServerDialogColumnPassword);
columnPassword.setEditingSupport(new HostEditingSupport(5, serverTable));
final TableViewerColumn columnAutosavePassword = new TableViewerColumn(serverTable, SWT.NONE);
columnAutosavePassword.getColumn().setWidth(40);
columnAutosavePassword.getColumn().setText(Messages.multiEditServerDialogColumnAutosavePassword);
columnAutosavePassword.getColumn().setToolTipText(Messages.multiEditServerDialogColumnAutosavePassword);
columnAutosavePassword.setEditingSupport(new AutosavePasswordSupport(serverTable));
serverTable.setContentProvider(new ServerListContentProvider());
serverTable.setLabelProvider(new ServerListLabelProvider());
serverTable.setInput(tmpServerList);
return parentComp;
}
use of org.eclipse.jface.viewers.TableViewer in project cubrid-manager by CUBRID.
the class NewMultiHostConnectionDialog method createDialogArea.
protected Control createDialogArea(Composite parent) {
getShell().setText(Messages.multiConnectServerDialogTitle);
Composite parentComp = (Composite) super.createDialogArea(parent);
setTitle(Messages.multiConnectServerDialogTitle);
setMessage(Messages.multiConnectServerDialogMessages);
serverTable = new TableViewer(parentComp, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
serverTable.getTable().setLayoutData(gridData);
serverTable.getTable().setHeaderVisible(true);
serverTable.getTable().setLinesVisible(true);
final TableViewerColumn columnHost = new TableViewerColumn(serverTable, SWT.CENTER);
columnHost.getColumn().setWidth(120);
columnHost.getColumn().setText(Messages.multiConnectServerDialogColumnHostAddress);
final TableViewerColumn columnUser = new TableViewerColumn(serverTable, SWT.CENTER);
columnUser.getColumn().setWidth(200);
columnUser.getColumn().setText(Messages.multiConnectServerDialogColumnUser);
final TableViewerColumn columnErrMsg = new TableViewerColumn(serverTable, SWT.CENTER);
columnErrMsg.getColumn().setWidth(200);
columnErrMsg.getColumn().setText(Messages.multiConnectServerDialogColumnErrMsg);
final TableViewerColumn columnStatus = new TableViewerColumn(serverTable, SWT.CENTER);
columnStatus.getColumn().setWidth(100);
columnStatus.getColumn().setText(Messages.multiConnectServerDialogColumnStatus);
serverTable.setContentProvider(new ServerListContentProvider());
serverTable.setLabelProvider(new ServerListLabelProvider());
serverTable.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
FailedHostServerInfo multiHostConnectionFailedServerInfo = (FailedHostServerInfo) selection.getFirstElement();
editHost(multiHostConnectionFailedServerInfo);
}
});
serverTable.setInput(failedServerList);
MenuManager menuManager = new MenuManager();
Menu contextMenu = menuManager.createContextMenu(serverTable.getTable());
serverTable.getTable().setMenu(contextMenu);
Menu menu = new Menu(getShell(), SWT.POP_UP);
final MenuItem itemEdit = new MenuItem(menu, SWT.PUSH);
itemEdit.setText(Messages.msgConnectHostDialog);
itemEdit.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
IStructuredSelection selection = (StructuredSelection) serverTable.getSelection();
FailedHostServerInfo multiHostConnectionFailedServerInfo = (FailedHostServerInfo) selection.getFirstElement();
editHost(multiHostConnectionFailedServerInfo);
}
});
menu.addMenuListener(new MenuAdapter() {
public void menuShown(MenuEvent event) {
IStructuredSelection selection = (IStructuredSelection) serverTable.getSelection();
FailedHostServerInfo multiHostConnectionFailedServerInfo = (FailedHostServerInfo) selection.getFirstElement();
if (multiHostConnectionFailedServerInfo.getCubridServer().isConnected()) {
itemEdit.setEnabled(false);
} else {
itemEdit.setEnabled(true);
}
}
});
serverTable.getTable().setMenu(menu);
return parentComp;
}
use of org.eclipse.jface.viewers.TableViewer in project cubrid-manager by CUBRID.
the class DBSpaceLabelProvider method createBrokerInfoItem.
private void createBrokerInfoItem(ExpandBar bar, int index) {
ExpandItem brokerInfoItem = new ExpandItem(bar, SWT.NONE, index);
brokerInfoItem.setText(Messages.titleBrokerInfo);
Composite brokerComposite = new Composite(bar, SWT.None);
brokerComposite.setLayout(new FillLayout());
brokerTableViewer = new TableViewer(brokerComposite, SWT.BORDER | SWT.FULL_SELECTION);
brokerTableViewer.getTable().setHeaderVisible(true);
brokerTableViewer.getTable().setLinesVisible(true);
brokerTableViewer.setContentProvider(new BrokersStatusContentProvider());
BrokersStatusLabelProvider brokersStatusLabelProvider = new BrokersStatusLabelProvider();
brokersStatusLabelProvider.setServerInfo(serverInfo);
brokerTableViewer.setLabelProvider(brokersStatusLabelProvider);
TableColumn tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblBrokerName);
tblColumn.setToolTipText(Messages.tipBrokerName);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.CENTER);
tblColumn.setText(Messages.tblBrokerStatus);
tblColumn.setToolTipText(Messages.tipBrokerStatus);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblBrokerProcess);
tblColumn.setToolTipText(Messages.tipBrokerProcess);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblPort);
tblColumn.setToolTipText(Messages.tipPort);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblServer);
tblColumn.setToolTipText(Messages.tipServer);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblQueue);
tblColumn.setToolTipText(Messages.tipQueue);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblRequest);
tblColumn.setToolTipText(Messages.tipRequest);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblTps);
tblColumn.setToolTipText(Messages.tipTps);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblQps);
tblColumn.setToolTipText(Messages.tipQps);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblLongTran);
tblColumn.setToolTipText(Messages.tipLongTran);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblLongQuery);
tblColumn.setToolTipText(Messages.tipLongQuery);
tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
tblColumn.setText(Messages.tblErrQuery);
tblColumn.setToolTipText(Messages.tipErrQuery);
brokerInfoItem.setHeight(120);
brokerInfoItem.setExpanded(true);
brokerInfoItem.setControl(brokerComposite);
}
use of org.eclipse.jface.viewers.TableViewer in project cubrid-manager by CUBRID.
the class UnifyHostConfigEditor method createCubridCMConfTabItem.
/**
* create cubrid CM table
*/
public void createCubridCMConfTabItem() {
Composite comp = new Composite(confTabFolder, SWT.NONE);
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
comp.setLayout(new GridLayout(1, false));
cubridCMConfTableCTabItem = new CTabItem(confTabFolder, SWT.NONE);
cubridCMConfTableCTabItem.setText("cm.conf");
cubridCMConfTabTableViewer = new TableViewer(comp, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
cubridCMConfTabTableViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
cubridCMConfTabTableViewer.getTable().setHeaderVisible(true);
cubridCMConfTabTableViewer.getTable().setLinesVisible(true);
cubridCMConfTabTableViewer.setUseHashlookup(true);
//create column
TableViewerColumn column = new TableViewerColumn(cubridCMConfTabTableViewer, SWT.LEFT);
column.getColumn().setWidth(0);
column.getColumn().setText("");
cubridCMConfTabTableViewer.setContentProvider(new UnifyHostCubridCMConfTableContentProvider());
cubridCMConfTabTableViewer.setLabelProvider(new UnifyHostCubridCMConfTableLabelProvider());
//use to mark click point, the right click menu use this point
cubridCMConfTabTableViewer.getTable().addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
cubridCMConfTableClickPoint = new Point(event.x, event.y);
cubridCMConfTableClickPointTiming = System.currentTimeMillis();
}
});
registerCubridCMConfTableContextMenu();
cubridCMConfTableCTabItem.setControl(comp);
if (confTabFolder.getSelection() == null) {
confTabFolder.setSelection(cubridCMConfTableCTabItem);
}
}
Aggregations