當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。