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


Java TableViewerColumn.setLabelProvider方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.TableViewerColumn.setLabelProvider方法的典型用法代碼示例。如果您正苦於以下問題:Java TableViewerColumn.setLabelProvider方法的具體用法?Java TableViewerColumn.setLabelProvider怎麽用?Java TableViewerColumn.setLabelProvider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.TableViewerColumn的用法示例。


在下文中一共展示了TableViewerColumn.setLabelProvider方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createSourceTable

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的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

示例2: createTableColumns

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的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

示例3: createColumns

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private void createColumns(final TableViewer tableViewer) {
  final String[] titles = { "Icon", "Name", "Small", "Medium", "Large", "Source", "Class" };
  final int[] bounds = { 40, 200, 60, 60, 60, 200, 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,代碼來源:TableViewerFactory.java

示例4: createColumns

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private void createColumns(final TableViewer tableViewer) {
  final String[] titles = { "Relation", "Type", "Name" };
  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);

  // Object[] projectsToSelect = openProjects.toArray();
  // IViewPart view = window.getActivePage().showView( "org.eclipse.jdt.ui.PackageExplorer" );
  // view.getSite().getSelectionProvider().setSelection( new StructuredSelection( projectsToSelect ) );

}
 
開發者ID:AndreasWBartels,項目名稱:libraries,代碼行數:25,代碼來源:RelationsTableViewerFactory.java

示例5: createColumns

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的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.jface.viewers.TableViewerColumn; //導入方法依賴的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: defineColumn_ColumnName

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 * Column: Label
 */
private void defineColumn_ColumnName(final TableColumnLayout tableLayout) {

	final TableViewerColumn tvc = new TableViewerColumn(_columnViewer, SWT.LEAD);

	final TableColumn tc = tvc.getColumn();
	tc.setMoveable(true);
	tc.setText(Messages.ColumnModifyDialog_column_column);

	tvc.setLabelProvider(new CellLabelProvider() {
		@Override
		public void update(final ViewerCell cell) {

			final ColumnDefinition colDef = (ColumnDefinition) cell.getElement();
			cell.setText(colDef.getColumnLabel());

			setColor(cell, colDef);
		}
	});
	tableLayout.setColumnData(tc, new ColumnWeightData(30, true));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:24,代碼來源:DialogModifyColumns.java

示例8: defineColumn_Unit

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 * Column: Unit
 */
private void defineColumn_Unit(final TableColumnLayout tableLayout) {

	final TableViewerColumn tvc = new TableViewerColumn(_columnViewer, SWT.LEAD);

	final TableColumn tc = tvc.getColumn();
	tc.setText(Messages.ColumnModifyDialog_column_unit);
	tc.setMoveable(true);

	tvc.setLabelProvider(new CellLabelProvider() {
		@Override
		public void update(final ViewerCell cell) {

			final ColumnDefinition colDef = (ColumnDefinition) cell.getElement();
			cell.setText(colDef.getColumnUnit());

			setColor(cell, colDef);
		}
	});
	tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(14), true));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:24,代碼來源:DialogModifyColumns.java

示例9: defineColumn_Url

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 * Column: Url
 */
private void defineColumn_Url(final TableColumnLayout tableLayout) {

	final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.CENTER);
	final TableColumn tc = tvc.getColumn();

	tc.setText(Messages.Tour_Marker_Column_Url_ShortCut);
	tc.setToolTipText(Messages.Tour_Marker_Column_Url_Tooltip);
	tvc.setLabelProvider(new CellLabelProvider() {

		@Override
		public void update(final ViewerCell cell) {

			final TourMarker tourMarker = (TourMarker) cell.getElement();
			final String urlAddress = tourMarker.getUrlAddress();
			final String urlText = tourMarker.getUrlText();

			cell.setText(urlAddress.length() > 0 || urlText.length() > 0 ? //
					UI.SYMBOL_STAR
					: UI.EMPTY_STRING);
		}
	});
	tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(4), false));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:27,代碼來源:DialogMarker.java

示例10: createPropertiesTable

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private TableViewer createPropertiesTable(Composite parent) {
	Composite cmpItemPropertiesTableViewer=new Composite(parent, SWT.NONE);
	cmpItemPropertiesTableViewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,1,3));
	TableColumnLayout tl_itemPropertiesTableViewer = new TableColumnLayout();
	cmpItemPropertiesTableViewer.setLayout(tl_itemPropertiesTableViewer);
	
	TableViewer tv = new TableViewer(cmpItemPropertiesTableViewer,SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
	tv.getTable().setHeaderVisible(true);
	tv.getTable().setLinesVisible(true);
	
	TableViewerColumn tvcName = new TableViewerColumn(tv, SWT.NONE);
	tvcName.getColumn().setText(Messages.SPCVItemPropertiesList_ColName);
	tvcName.setLabelProvider(new ItemPropertyNameLabelProvider());
	tl_itemPropertiesTableViewer.setColumnData(tvcName.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));

	TableViewerColumn tvcValue = new TableViewerColumn(tv, SWT.NONE);
	tvcValue.getColumn().setText(Messages.SPCVItemPropertiesList_ColValue);
	tvcValue.setLabelProvider(new ItemPropertyValueLabelProvider());
	tl_itemPropertiesTableViewer.setColumnData(tvcValue.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
	
	tv.setContentProvider(new ArrayContentProvider());

	return tv;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:25,代碼來源:SPCVItemPropertiesList.java

示例11: createPropertiesTable

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
private TableViewer createPropertiesTable(Composite parent) {
	Composite cmpItemPropertiesTableViewer=new Composite(parent, SWT.NONE);
	cmpItemPropertiesTableViewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,1,3));
	TableColumnLayout tl_itemPropertiesTableViewer = new TableColumnLayout();
	cmpItemPropertiesTableViewer.setLayout(tl_itemPropertiesTableViewer);
	
	TableViewer tv = new TableViewer(cmpItemPropertiesTableViewer,SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
	tv.getTable().setHeaderVisible(true);
	tv.getTable().setLinesVisible(true);
	
	TableViewerColumn tvcName = new TableViewerColumn(tv, SWT.NONE);
	tvcName.getColumn().setText(Messages.ElementItemDialog_NameColumn);
	tvcName.setLabelProvider(getItemPropertyNameLabelProvider());
	tl_itemPropertiesTableViewer.setColumnData(tvcName.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));

	TableViewerColumn tvcValue = new TableViewerColumn(tv, SWT.NONE);
	tvcValue.getColumn().setText(Messages.ElementItemDialog_ValueColumn);
	tvcValue.setLabelProvider(getItemPropertyValueLabelProvider());
	tl_itemPropertiesTableViewer.setColumnData(tvcValue.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
	
	tv.setContentProvider(new ArrayContentProvider());

	return tv;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:25,代碼來源:ElementItemDialog.java

示例12: defineColumn_Width

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 * Column: Width
 */
private void defineColumn_Width(final TableColumnLayout tableLayout) {

	final TableViewerColumn tvc = new TableViewerColumn(_columnViewer, SWT.TRAIL);

	final TableColumn tc = tvc.getColumn();
	tc.setMoveable(true);
	tc.setText(Messages.ColumnModifyDialog_column_width);

	tvc.setLabelProvider(new CellLabelProvider() {
		@Override
		public void update(final ViewerCell cell) {

			final ColumnDefinition colDef = (ColumnDefinition) cell.getElement();
			cell.setText(Integer.toString(colDef.getColumnWidth()));

			setColor(cell, colDef);
		}
	});
	tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(10), true));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:24,代碼來源:DialogModifyColumns.java

示例13: defineColumn_Description

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 * Column: Description
 */
private void defineColumn_Description(final TableColumnLayout tableLayout) {

	final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.CENTER);
	final TableColumn tc = tvc.getColumn();

	tc.setText(Messages.Tour_Marker_Column_Description_ShortCut);
	tc.setToolTipText(Messages.Tour_Marker_Column_Description_Tooltip);
	tvc.setLabelProvider(new CellLabelProvider() {

		@Override
		public void update(final ViewerCell cell) {

			final TourMarker tourMarker = (TourMarker) cell.getElement();
			final String description = tourMarker.getDescription();

			cell.setText(description.length() == 0 ? UI.EMPTY_STRING : UI.SYMBOL_STAR);
		}
	});
	tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(4), false));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:24,代碼來源:DialogMarker.java

示例14: updateTableFromTextEditor

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 *
 */
void updateTableFromTextEditor() {
	model.removeModelListener(csvFileListener);
	model.setInput(editor.getDocumentProvider().getDocument(editor.getEditorInput()).get());
	final TableColumn[] columns = tableViewer.getTable().getColumns();
	for (final TableColumn c : columns) {
		c.dispose();
	}
	for (int i = 0; i < model.getHeader().size(); i++) {
		final TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.LEFT);
		final int index = i;
		column.getColumn().setText(model.getHeader().get(i));
		column.getColumn().setWidth(100);
		column.getColumn().setResizable(true);
		column.getColumn().setMoveable(true);
		column.setLabelProvider(new CSVLabelProvider());
		addMenuItemToColumn(column.getColumn(), index);
	}
	tableViewer.setInput(model);
	model.addModelListener(csvFileListener);
	defineCellEditing();
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:25,代碼來源:MultiPageCSVEditor.java

示例15: defineColumn_OffsetX

import org.eclipse.jface.viewers.TableViewerColumn; //導入方法依賴的package包/類
/**
 * column: horizontal offset
 */
private void defineColumn_OffsetX(final TableColumnLayout tableLayout) {

	final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.TRAIL);
	final TableColumn tc = tvc.getColumn();

	tc.setText(Messages.Tour_Marker_Column_horizontal_offset);
	tc.setToolTipText(Messages.Tour_Marker_Column_horizontal_offset_tooltip);
	tvc.setLabelProvider(new CellLabelProvider() {

		@Override
		public void update(final ViewerCell cell) {

			final TourMarker tourMarker = (TourMarker) cell.getElement();
			cell.setText(Integer.toString(tourMarker.getLabelXOffset()));
		}
	});
	tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(6), false));
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:22,代碼來源:DialogMarker.java


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