本文整理汇总了Java中org.eclipse.swt.widgets.TableColumn.setText方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumn.setText方法的具体用法?Java TableColumn.setText怎么用?Java TableColumn.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.TableColumn
的用法示例。
在下文中一共展示了TableColumn.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewer
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
@Override
protected TableViewer createViewer(final Composite parent, final AbstractColumnLayout columnLayout, final int style) {
final TableViewer viewer = new TableViewer(parent, style);
final Table table = viewer.getTable();
table.setLinesVisible(linesVisible);
table.setHeaderVisible(headerVisible);
int columnIndex = 0;
for (final String columnLabel : columnLabels) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, NONE);
final TableColumn column = viewerColumn.getColumn();
columnLayout.setColumnData(column, createColumnLayoutData(columnIndex));
column.setText(columnLabel);
column.setMoveable(moveable);
columnIndex++;
}
return viewer;
}
示例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: createSourceTable
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void createSourceTable(SashForm sashForm) {
avaliableFieldTableViewer = new TableViewer(sashForm, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
table_1 = avaliableFieldTableViewer.getTable();
table_1.setLinesVisible(true);
table_1.setHeaderVisible(true);
avaliableFieldTableViewer.setContentProvider(new IStructuredContentProvider() {
@Override
public Object[] getElements(Object inputElement) {
return ((List) inputElement).toArray();
}
});
avaliableFieldTableViewer.setInput(schemaFields);
TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(avaliableFieldTableViewer, SWT.NONE);
TableColumn tblclmnNewColumn_2 = tableViewerColumn_2.getColumn();
tblclmnNewColumn_2.setWidth(196);
tblclmnNewColumn_2.setText(Messages.AVAILABLE_FIELDS_HEADER);
tableViewerColumn_2.setLabelProvider(new ColumnLabelProvider());
attachDragListener();
}
示例4: createTableColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private TableViewer createTableColumns(Composite tableComposite) {
TableViewer tableViewer = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION);
excelFormatterTable = tableViewer.getTable();
excelFormatterTable.setHeaderVisible(true);
excelFormatterTable.setLinesVisible(true);
excelFormatterTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
TableColumn parameterNameColumn = tableViewerColumn.getColumn();
parameterNameColumn.setWidth(254);
parameterNameColumn.setText(Messages.PARAMETER_NAME);
tableViewerColumn.setLabelProvider(new ParameterNameLabelProvider());
TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE);
TableColumn parameterValueColumn = tableViewerColumn_1.getColumn();
parameterValueColumn.setWidth(251);
parameterValueColumn.setText(Messages.PARAMETER_VALUE);
tableViewerColumn_1.setLabelProvider(new ParameterValueLabelProvider());
return tableViewer;
}
示例5: createColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void createColumns(final TableViewer tableViewer) {
final String[] titles = { "Class" };
final int[] bounds = { 120, 100, 200 };
for (int i = 0; i < titles.length; i++) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
tableViewer.setSorter(new TableViewerSorter(titles));
viewerColumn.setLabelProvider(new TableCellLabelProvider());
final TableColumn column = viewerColumn.getColumn();
column.addSelectionListener(new ColumnSelectionListener(column, tableViewer));
column.setText(titles[i]);
column.setWidth(bounds[i]);
column.setResizable(true);
column.setMoveable(false);
}
final Table table = tableViewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
ColumnViewerToolTipSupport.enableFor(tableViewer, ToolTip.RECREATE);
}
示例6: createColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void createColumn(int idx, int align) {
TableViewerColumn viewerColumn = new TableViewerColumn(viewer, align, idx);
viewerColumn.setEditingSupport(new TableEditingSupport(viewer, idx));
viewerColumn.setLabelProvider(new ColumnLabelProvider() {
private int col = idx;
public String getText(Object element) {
if (element instanceof Row) {
return ((Row) element).data[col];
}
return super.getText(element);
}
});
TableColumn column = viewerColumn.getColumn();
column.setResizable(true);
column.setMoveable(true);
column.setText(tableModel.headers[idx]);
int width = convertWidthInCharsToPixels(tableModel.colWidths[idx]);
width = Math.max(width, 50);
column.setWidth(width);
}
示例7: createTable
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
protected TableViewer createTable(Composite parent, int span) {
Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
data.horizontalSpan = span;
data.heightHint = 125;
table.setLayoutData(data);
TableLayout layout = new TableLayout();
layout.addColumnData(new ColumnWeightData(100, true));
table.setLayout(layout);
TableColumn col = new TableColumn(table, SWT.NONE);
col.setResizable(true);
col.setText(Policy.bind("SVNFoldersExistWarningPage.folders")); //$NON-NLS-1$
table.setHeaderVisible(true);
return new TableViewer(table);
}
示例8: createSourceTable
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void createSourceTable(Composite composite_2) {
sourceTable = new Table(composite_2, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
sourceTable.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
if(sourceTable.getSelection().length==1){
addNewProperty(targetTableViewer, sourceTable.getSelection()[0].getText());
enableControlButtons();
}
}
});
GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
gd_table.widthHint = 221;
gd_table.heightHint = 407;
sourceTable.setLayoutData(gd_table);
sourceTable.setHeaderVisible(true);
sourceTable.setLinesVisible(true);
TableColumn sourceTableColumnFieldName = new TableColumn(sourceTable, SWT.LEFT);
if(OSValidator.isMac()){
sourceTableColumnFieldName.setWidth(212);
}else{
sourceTableColumnFieldName.setWidth(202);
}
sourceTableColumnFieldName.setText(Messages.AVAILABLE_FIELDS_HEADER);
getSourceFieldsFromPropagatedSchema(sourceTable);
dragSource = new DragSource(sourceTable, DND.DROP_MOVE);
dragSource.setTransfer(new Transfer[] { TextTransfer.getInstance() });
dragSource.addDragListener(new DragSourceAdapter() {
public void dragSetData(DragSourceEvent event) {
// Set the data to be the first selected item's text
event.data = formatDataToTransfer(sourceTable.getSelection());
}
});
}
示例9: 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 ) );
}
}
示例10: createTableViewerColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
/**
* Creates columns for the Table Viewer
*
* @param tableViewer
* @return tableViewerColumn
*/
public TableViewerColumn createTableViewerColumns(TableViewer tableViewer, String columnName) {
TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
TableColumn tblclmnItem = tableViewerColumn.getColumn();
tblclmnItem.setWidth(180);
tblclmnItem.setText(columnName);
return tableViewerColumn;
}
示例11: setColumnsName
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private void setColumnsName (TableViewer tv) {
for (int i = 0; i < ColumnsConst.COLUMNS.length; i++) {
TableColumn col = new TableColumn(tv.getTable(), SWT.LEFT );
col.setText(ColumnsConst.COLUMNS[i]);
col.setData(new Integer (i));
col.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
TableColumn tc = (TableColumn)event.getSource();
Integer index = (Integer)tc.getData();
((PerformanceStatsViewerSorter) tv.getComparator()).doSort(index);
tv.refresh();
}
});
}
}
示例12: createTableViewerColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int bound, final int colNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setWidth(bound);
column.setResizable(true);
column.setMoveable(true);
return viewerColumn;
}
示例13: createTableViewerColumn
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, final int colNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setResizable(true);
return viewerColumn;
}
示例14: AvailableFieldsComposite
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
/**
* Create the composite.
* @param parent
* @param style
*/
public AvailableFieldsComposite(Composite parent, int style , Map<String,Class<?>> fieldMap) {
super(parent, style);
setLayout(new GridLayout(1, false));
this.inputFields=new ArrayList<>(fieldMap.keySet());
this.fieldMap=fieldMap;
headerComposite_1 = new Composite(this, SWT.NONE);
headerComposite_1.setLayout(new GridLayout(2, false));
GridData gd_headerComposite_1 = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
gd_headerComposite_1.widthHint = 437;
gd_headerComposite_1.heightHint = 39;
headerComposite_1.setLayoutData(gd_headerComposite_1);
Label lblAvailableFields = new Label(headerComposite_1, SWT.NONE);
lblAvailableFields.setText(Messages.AVAILABLE_INPUT_FIELDS);
createSearchTextBox(headerComposite_1);
tableViewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION);
table = tableViewer.getTable();
table.setLinesVisible(true);
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
table.setHeaderVisible(true);
availableFieldsNameColumn = new TableColumn(table, SWT.NONE);
availableFieldsNameColumn.setText(Messages.FIELD_NAME);
availableFieldsDataTypeColumn = new TableColumn(table, SWT.NONE);
availableFieldsDataTypeColumn.setText(Messages.DATA_TYPE);
ExpressionEditorUtil.INSTANCE.addDragSupport(table);
loadData();
addControlListener();
addDoubleClickListener();
}
示例15: createTableColumns
import org.eclipse.swt.widgets.TableColumn; //导入方法依赖的package包/类
/**
* Creates the table columns.
*
* @param table
* the table
* @param fields
* the fields
*/
public static void createTableColumns(Table table,String[] fields){
for (String field : fields) {
TableColumn tc = new TableColumn(table, SWT.CENTER);
tc.setText(field);
tc.setMoveable(true);
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
}