use of com.cubrid.cubridmanager.ui.host.editor.ServerInfoTableViewerLabelProvider in project cubrid-manager by CUBRID.
the class ImportExportConnectionDialog method createTable.
private void createTable(Composite composite) {
hostListView = CheckboxTableViewer.newCheckList(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION);
hostListView.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
if (isExport) {
valid();
}
}
});
final GridData gdColumnsTable = new GridData(SWT.FILL, SWT.FILL, true, true);
gdColumnsTable.horizontalSpan = 3;
gdColumnsTable.heightHint = 189;
hostListView.getTable().setLayoutData(gdColumnsTable);
hostListView.getTable().setLinesVisible(true);
hostListView.getTable().setHeaderVisible(true);
final TableColumn hostName = new TableColumn(hostListView.getTable(), SWT.NONE);
hostName.setAlignment(SWT.LEFT);
hostName.setWidth(WIDTH_NAME);
hostName.setText(Messages.columnHeaderServerInfo);
if (isExport) {
hostName.setImage(CommonUIPlugin.getImage("icons/checked_green.png"));
} else {
hostName.setImage(CommonUIPlugin.getImage("icons/unchecked.gif"));
}
hostName.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
selectAll = !selectAll;
hostListView.setAllChecked(selectAll);
Image image = selectAll ? CommonUIPlugin.getImage("icons/checked_green.png") : CommonUIPlugin.getImage("icons/unchecked.gif");
hostName.setImage(image);
hostListView.refresh();
if (isExport) {
valid();
}
}
});
final TableColumn hostAddress = new TableColumn(hostListView.getTable(), SWT.NONE);
hostAddress.setAlignment(SWT.CENTER);
hostAddress.setWidth(WIDTH_ADDRESS);
hostAddress.setText(Messages.columnHeaderServerAddress);
final TableColumn hostPort = new TableColumn(hostListView.getTable(), SWT.NONE);
hostPort.setAlignment(SWT.CENTER);
hostPort.setWidth(WIDTH_PORT);
hostPort.setText(Messages.columnHeaderServerPort);
final TableColumn jdbcVer = new TableColumn(hostListView.getTable(), SWT.NONE);
jdbcVer.setAlignment(SWT.CENTER);
jdbcVer.setWidth(WIDTH_JDBC);
jdbcVer.setText(Messages.columnHeaderServerJdbcVersion);
final TableColumn hostUser = new TableColumn(hostListView.getTable(), SWT.NONE);
hostUser.setAlignment(SWT.CENTER);
hostUser.setWidth(WIDTH_USER);
hostUser.setText(Messages.columnHeaderServerUserName);
// final TableColumn savedPass = new TableColumn(hostListView.getTable(), SWT.NONE);
// savedPass.setAlignment(SWT.CENTER);
// savedPass.setWidth(WIDTH_SAVEPASS);
// savedPass.setText(Messages.columnHeaderServerAutoSave);
hostListView.setContentProvider(new ServerInfoTableViewerContentProvider());
hostListView.setLabelProvider(new ServerInfoTableViewerLabelProvider());
if (isExport) {
initExportTableData();
}
}
Aggregations