use of org.eclipse.jface.viewers.TableViewerColumn in project cubrid-manager by CUBRID.
the class BrokerConfigEditComposite method createBrokerConfTableData.
/**
* Create table data by CubridBrokerConf model
*/
public void createBrokerConfTableData() {
// remove column
int oldCount = confTableViewer.getTable().getColumnCount();
for (int i = 0; i < oldCount; i++) {
confTableViewer.getTable().getColumn(0).dispose();
}
// create column
TableViewerColumn column = new TableViewerColumn(confTableViewer, SWT.LEFT);
column.getColumn().setWidth(150);
column.getColumn().setText(Messages.cubridBrokerConfEditorColumnPropName);
column.setEditingSupport(new PropValueEditingSupport(confTableViewer, 0));
for (int i = 0; i < brokerConfig.getPropertyList().size(); i++) {
TableViewerColumn propColumn = new TableViewerColumn(confTableViewer, SWT.LEFT);
propColumn.getColumn().setWidth(160);
propColumn.getColumn().setText(Messages.cubridBrokerConfEditorBrokerTitle + i);
propColumn.setEditingSupport(new PropValueEditingSupport(confTableViewer, i + 1));
propColumn.getColumn().addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
noOp();
}
});
}
confTableViewer.setLabelProvider(confTableLabelProvider);
confTableViewer.setInput(confListData);
confListData.clear();
confListData.addAll(editorPart.parseBrokerConfigToCommonTableValue(brokerConfig));
confTableViewer.refresh();
}
use of org.eclipse.jface.viewers.TableViewerColumn in project translationstudio8 by heartsome.
the class ExportTbxDialog method createColumn.
/**
* 创建Table列
* @param viewer
* ;
*/
private void createColumn(final TableViewer viewer) {
String[] clmnTitles = { Messages.getString("dialog.ExportTbxDialog.clmnTitles1"), Messages.getString("dialog.ExportTbxDialog.clmnTitles2"), Messages.getString("dialog.ExportTbxDialog.clmnTitles3"), Messages.getString("dialog.ExportTbxDialog.clmnTitles4") };
int[] clmnBounds = { 50, 80, 100, 100 };
TableViewerColumn col = createTableViewerColumn(viewer, clmnTitles[0], clmnBounds[0], 0);
col.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
ExportDatabaseBean bean = (ExportDatabaseBean) element;
return bean.getIndex();
}
});
col = createTableViewerColumn(viewer, clmnTitles[1], clmnBounds[1], 1);
col.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
ExportDatabaseBean bean = (ExportDatabaseBean) element;
return bean.getDbBean().getDbType();
}
});
col = createTableViewerColumn(viewer, clmnTitles[2], clmnBounds[2], 2);
col.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
ExportDatabaseBean bean = (ExportDatabaseBean) element;
return bean.getDbBean().getDatabaseName();
}
});
col = createTableViewerColumn(viewer, clmnTitles[3], clmnBounds[3], 3);
col.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
ExportDatabaseBean bean = (ExportDatabaseBean) element;
return bean.getExistLangs();
}
});
}
use of org.eclipse.jface.viewers.TableViewerColumn in project translationstudio8 by heartsome.
the class ExportTbxDialog method createTableViewerColumn.
/**
* 设置TableViewer 列属性
* @param viewer
* @param title
* 列标题
* @param bound
* 列宽
* @param colNumber
* 列序号
* @return {@link TableViewerColumn};
*/
private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setWidth(bound);
column.setResizable(true);
column.setMoveable(true);
return viewerColumn;
}
use of org.eclipse.jface.viewers.TableViewerColumn in project translationstudio8 by heartsome.
the class ProjectSettingTBPage method createTableViewerColumn.
/**
* 设置TableViewer 列属性
* @param viewer
* @param title
* 列标题
* @param bound
* 列宽
* @param colNumber
* 列序号
* @return {@link TableViewerColumn};
*/
private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setWidth(bound);
column.setResizable(true);
column.setMoveable(true);
return viewerColumn;
}
use of org.eclipse.jface.viewers.TableViewerColumn in project translationstudio8 by heartsome.
the class ExportTmxDialog method createColumn.
/**
* 创建Table列
* @param viewer
* ;
*/
private void createColumn(final TableViewer viewer) {
String[] clmnTitles = { Messages.getString("dialog.ExportTmxDialog.clmnTitles1"), Messages.getString("dialog.ExportTmxDialog.clmnTitles2"), Messages.getString("dialog.ExportTmxDialog.clmnTitles3"), Messages.getString("dialog.ExportTmxDialog.clmnTitles4") };
int[] clmnBounds = { 50, 80, 100, 100 };
TableViewerColumn col = createTableViewerColumn(viewer, clmnTitles[0], clmnBounds[0], 0);
col.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
ExportDatabaseBean bean = (ExportDatabaseBean) element;
return bean.getIndex();
}
});
col = createTableViewerColumn(viewer, clmnTitles[1], clmnBounds[1], 1);
col.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
ExportDatabaseBean bean = (ExportDatabaseBean) element;
return bean.getDbBean().getDbType();
}
});
col = createTableViewerColumn(viewer, clmnTitles[2], clmnBounds[2], 2);
col.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
ExportDatabaseBean bean = (ExportDatabaseBean) element;
return bean.getDbBean().getDatabaseName();
}
});
col = createTableViewerColumn(viewer, clmnTitles[3], clmnBounds[3], 3);
col.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
ExportDatabaseBean bean = (ExportDatabaseBean) element;
return bean.getExistLangs();
}
});
}
Aggregations