當前位置: 首頁>>代碼示例>>Java>>正文


Java TableColumn.setText方法代碼示例

本文整理匯總了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;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:22,代碼來源:TableViewerBuilder.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: 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();
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:ExcelFormattingDialog.java

示例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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:21,代碼來源:HeaderAndDataFormattingDialog.java

示例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);
}
 
開發者ID:AndreasWBartels,項目名稱:libraries,代碼行數:20,代碼來源:TypesTableViewerFactory.java

示例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);
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:26,代碼來源:TableDialog.java

示例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);
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:17,代碼來源:SvnFoldersExistWarningPage.java

示例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());
		}

	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:38,代碼來源:SecondaryColumnKeysDialog.java

示例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 ) );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:33,代碼來源:QueryDataView.java

示例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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:15,代碼來源:HydrographInstallationDialog.java

示例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();
           }
      });
  }
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:16,代碼來源:PerformanceView.java

示例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;
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:10,代碼來源:ResultView.java

示例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;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:8,代碼來源:ModelSearchPage.java

示例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();
	
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:38,代碼來源:AvailableFieldsComposite.java

示例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);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:18,代碼來源:WidgetUtility.java


注:本文中的org.eclipse.swt.widgets.TableColumn.setText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。