当前位置: 首页>>代码示例>>Java>>正文


Java TableColumn.setAlignment方法代码示例

本文整理汇总了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;
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:20,代码来源:DataModelFormPage.java

示例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);
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:24,代码来源:BaseZnodeModelTableFormPage.java

示例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);
    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:15,代码来源:ViewerFactory.java

示例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 ) );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:33,代码来源:QueryDataView.java

示例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;
}
 
开发者ID:Pardus-LiderAhenk,项目名称:lider-ahenk-installer,代码行数:19,代码来源:AhenkNetworkScanPage.java

示例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;
}
 
开发者ID:dakaraphi,项目名称:eclipse-plugin-commander,代码行数:7,代码来源:ColumnOptions.java


注:本文中的org.eclipse.swt.widgets.TableColumn.setAlignment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。