本文整理匯總了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;
}