本文整理汇总了Java中org.eclipse.swt.widgets.TableColumn.setAlignment方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumn.setAlignment方法的具体用法?Java TableColumn.setAlignment怎么用?Java TableColumn.setAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.TableColumn
的用法示例。
在下文中一共展示了TableColumn.setAlignment方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTableSection
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
protected Section createTableSection(ScrolledForm form, Composite client, FormToolkit toolkit, String title,
Image image, int sectionStyle, int tableStyle, String[] columnTitles, int[] columnAlignments) {
Section section = createSection(form, client, toolkit, title, image, sectionStyle);
Table table = toolkit.createTable(section, tableStyle);
for (int i = 0; i < columnTitles.length; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(columnTitles[i]);
column.setAlignment(columnAlignments[i]);
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
section.setClient(table);
return section;
}
示例2: createTableColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
protected void createTableColumns() {
Table table = getTable();
if (table == null) {
return;
}
String[] titles = getTableColumnTitles();
if (titles != null && titles.length > 0) {
int[] columnAlignments = getTableColumnAlignments();
for (int i = 0; i < titles.length; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(titles[i]);
if (columnAlignments != null) {
column.setAlignment(columnAlignments[i]);
}
}
table.setHeaderVisible(true);
}
}
示例3: createTableColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private static void createTableColumns(Table table, IElementType tableElementType) {
String[] columnTitles = tableElementType.getColumnTitles();
int[] columnAlignments = tableElementType.getColumnAlignments();
for (int i = 0; i < columnTitles.length; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(columnTitles[i]);
column.setAlignment(columnAlignments[i]);
column.setMoveable(true);
}
table.setHeaderVisible(true);
}
示例4: setDataSize
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void setDataSize ( final int entries, final Set<String> valueTypes )
{
clearDataSize ();
this.colNames = valueTypes.toArray ( new String[0] );
for ( final String valueType : valueTypes )
{
final TableColumn col = new TableColumn ( this.table, SWT.NONE );
col.setText ( valueType );
col.setWidth ( 100 );
col.setAlignment ( SWT.RIGHT );
this.columns.put ( valueType, col );
}
this.countCol = new TableColumn ( this.table, SWT.NONE );
this.countCol.setText ( Messages.QueryDataView_ColValues );
this.countCol.setWidth ( 40 );
this.infoCol = new TableColumn ( this.table, SWT.NONE );
this.infoCol.setText ( Messages.QueryDataView_ColInfo );
this.infoCol.setWidth ( 150 );
this.table.clearAll ();
this.table.setItemCount ( entries );
for ( int i = 0; i < entries; i++ )
{
final TableItem item = this.table.getItem ( i );
item.setBackground ( this.invalidColor );
item.setText ( 0, String.format ( Messages.QueryDataView_Format_Index, i ) );
}
}
示例5: createTableViewerColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
/**
* Helper method to create table columns
*
* @param tblVwrSetup
* @param title
* @param bound
* @return
*/
private TableViewerColumn createTableViewerColumn(final TableViewer tblVwrSetup, String title, int bound) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tblVwrSetup, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setWidth(bound);
column.setResizable(true);
column.setMoveable(false);
column.setAlignment(SWT.LEFT);
return viewerColumn;
}
示例6: setColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
public ColumnOptions<T> setColumn(TableColumn column) {
this.column = column;
column.setWidth(columnWidth);
column.setAlignment(columnAlignment);
return this;
}