当前位置: 首页>>代码示例>>Java>>正文


Java TableViewer.setContentProvider方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.TableViewer.setContentProvider方法的典型用法代码示例。如果您正苦于以下问题:Java TableViewer.setContentProvider方法的具体用法?Java TableViewer.setContentProvider怎么用?Java TableViewer.setContentProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.TableViewer的用法示例。


在下文中一共展示了TableViewer.setContentProvider方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void createTableViewer() {
	ArrayEditor arrayEditor = ((ArrayEditor) cellEditor);

	tableViewer = new TableViewer(table);
	tableViewer.setUseHashlookup(true);
	tableViewer.setColumnProperties(arrayEditor.columnNames);

	// Assign the cell editors to the viewer
	CellEditor[] editors = arrayEditor.getColumnEditors(table);
	tableViewer.setCellEditors(editors);

	// Set the cell modifier for the viewer
	tableViewer.setCellModifier(new ArrayEditorCellModifier(this, tableViewer));
	
	// Set the label provider for the viewer
	tableViewer.setLabelProvider(new ArrayEditorLabelProvider(cellEditor.getStyle()));
	
	// Set the content provider
	tableViewer.setContentProvider(new ArrayEditorContentProvider());
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:ArrayEditorComposite.java

示例2: createTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void createTableViewer() {
	TableEditor tableEditor = ((TableEditor) cellEditor);

	tableViewer = new TableViewer(table);
	tableViewer.setUseHashlookup(true);
	tableViewer.setColumnProperties(tableEditor.columnNames);

	// Assign the cell editors to the viewer
	CellEditor[] editors = tableEditor.getColumnEditors(table);
	tableViewer.setCellEditors(editors);

	// Set the cell modifier for the viewer
	tableViewer.setCellModifier(new TableEditorCellModifier(this, tableViewer));
	
	// Set the label provider for the viewer
	tableViewer.setLabelProvider(new TableEditorLabelProvider());
	
	// Set the content provider
	tableViewer.setContentProvider(new TableEditorContentProvider());
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:TableEditorComposite.java

示例3: createPartControl

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
/**
 * Create contents of the view part.
 * @param parent
 */
public void createPartControl(Composite parent) {

	viewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE);

	viewer.getTable().setLinesVisible(true);
	viewer.getTable().setHeaderVisible(true);
	viewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));

	createColumns(viewer, "Name", "Value", "Type");

	viewer.setContentProvider(new ScannableContentProvider(cservice));

	try {
		viewer.setInput(getMonitors());
	} catch (Exception e) {
		logger.error("Cannot find selected monitors");
	}

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:24,代码来源:ScannableViewer.java

示例4: createDialogArea

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent)
{
	Composite dialogArea = (Composite) super.createDialogArea(parent);
	Composite composite = new Composite(dialogArea, SWT.NONE);
	createMessageArea(composite);
	listViewer = new TableViewer(composite, SWT.TOP | SWT.BORDER);

	GridData data = new GridData(GridData.FILL_BOTH);
	data.widthHint = 400;
	data.heightHint = 400;
	listViewer.getTable().setLayoutData(data);
	listViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
	listViewer.setContentProvider(new JarProjectContentProvider(null));
	listViewer.setComparator(new ViewerComparator());
	listViewer.setInput(ResourcesPlugin.getWorkspace());
	applyDialogFont(composite);

	listViewer.setSelection(new StructuredSelection(initialSelection));
	GridLayoutFactory.fillDefaults().generateLayout(composite);
	return dialogArea;
}
 
开发者ID:equella,项目名称:Equella,代码行数:23,代码来源:JPFProjectSelectionDialog.java

示例5: createPartControl

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
/**
 * This is a callback that will allow us
 * to create the viewer and initialize it.
 */
public void createPartControl(Composite parent) {
	viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	setColumnsName(viewer);
	
	viewer.setContentProvider(new ExecutionContentProvider());
	viewer.setLabelProvider(new ViewLabelProvider());
	viewer.setComparator(new PerformanceStatsViewerSorter());
	viewer.getTable().setData(PERFORMANCE_VIEW_WIDGET_ID,PERFORMANCE_VIEW_TABLE);
	getSite().setSelectionProvider(viewer);
	makeActions();
	hookContextMenu();
	 
	contributeToActionBars();
	
	load () ;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:21,代码来源:PerformanceView.java

示例6: createControl

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
/**
 * Create contents of the wizard.
 * 
 * @param parent
 */
public void createControl(Composite parent) {
  Composite container = new Composite(parent, SWT.NULL);

  setControl(container);
  container.setLayout(new GridLayout(1, false));

  TableViewer tableViewer = new TableViewer(container, SWT.BORDER | SWT.FULL_SELECTION);
  table = tableViewer.getTable();
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

  tableViewer.setContentProvider(ArrayContentProvider.getInstance());
  tableViewer.setInput(candidateList);
  tableViewer.setLabelProvider(new MarkerColumn());
  // auto size columns
  TableColumn[] columns = tableViewer.getTable().getColumns();
  for (int i = 0; i < columns.length; i++) {
    columns[i].pack();
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:27,代码来源:SelectionWizardPage.java

示例7: setTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public TableViewer setTableViewer(TableViewer tableViewer, Composite composite, String[] prop,
		IStructuredContentProvider iStructuredContentProvider, ITableLabelProvider iTableLabelProvider) {

	tableViewer.setContentProvider(iStructuredContentProvider);

	tableViewer.setColumnProperties(prop);

	tableViewerTable = tableViewer.getTable();

	tableViewerTable.setVisible(true);
	tableViewerTable.setLinesVisible(true);
	tableViewerTable.setHeaderVisible(true);
	createTableColumns(tableViewerTable, prop);
	editors = createCellEditorList(tableViewerTable, prop.length);
	tableViewer.setCellEditors(editors);

	TableViewerEditor.create(tableViewer, new ColumnViewerEditorActivationStrategy(tableViewer),
			ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
					| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

	return tableViewer;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:ELTOperationClassDialog.java

示例8: setTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public TableViewer setTableViewer(TableViewer tableViewer, Composite composite, String[] prop,
		IStructuredContentProvider iStructuredContentProvider) {

	tableViewer.setContentProvider(iStructuredContentProvider);

	tableViewer.setColumnProperties(prop);

	tableViewerTable = tableViewer.getTable();

	tableViewerTable.setVisible(true);
	tableViewerTable.setLinesVisible(true);
	tableViewerTable.setHeaderVisible(true);
	createTableColumns(tableViewerTable, prop);
	editors = createCellEditorList(tableViewerTable, prop.length);
	tableViewer.setCellEditors(editors);

	TableViewerEditor.create(tableViewer, new ColumnViewerEditorActivationStrategy(tableViewer),
			ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
					| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

	return tableViewer;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:TransformDialog.java

示例9: createSourceTable

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的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

示例10: createPartControl

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {

	viewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE);

	viewer.getTable().setLinesVisible(true);
	viewer.getTable().setHeaderVisible(false);
	viewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));

	createColumns(viewer, "", "Name");


	try {
		this.dservice = ServiceHolder.getEventService().createRemoteService(getUri(), IRunnableDeviceService.class);
		viewer.setContentProvider(new DetectorContentProvider(dservice));
	} catch (Exception e) {
		logger.error("Cannot create content provider", e);
	}
	viewer.setInput(new Object());

	selectionProvider = new DelegatingSelectionProvider(viewer);
	getSite().setSelectionProvider(selectionProvider);

	createActions();
	initializeToolBar();
	initializeMenu();

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:29,代码来源:DetectorView.java

示例11: createDialogArea

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {

	// create a composite with standard margins and spacing
	Composite composite = (Composite)super.createDialogArea(parent);
	composite.setLayout(new GridLayout(1, false));

	final CLabel warning = new CLabel(composite, SWT.LEFT);
	warning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	warning.setImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/error.png").createImage());
	warning.setText("Expert queue configuration parameters, please use with caution.");

	TableViewer viewer   = new TableViewer(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
	viewer.setUseHashlookup(true);
	viewer.getTable().setHeaderVisible(true);
	viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	createColumns(viewer);
	viewer.setContentProvider(createContentProvider());

	viewer.setInput(props);

	final Button adv = new Button(composite, SWT.PUSH);
	adv.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
	adv.setText("Advanced...");

	adv.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(getShell(), "org.dawnsci.commandserver.ui.activemqPage", null, null);
			if (pref != null) pref.open();
		}
	});

	return composite;
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:37,代码来源:PropertiesDialog.java

示例12: createViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
private void createViewer(Composite parent) {
	viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER | SWT.CHECK | SWT.READ_ONLY | SWT.PUSH);
	createColumns(parent, viewer);
	final Table table = viewer.getTable();
	table.setHeaderVisible(true);
	table.setLinesVisible(true);

	viewer.getTable().addListener(SWT.Selection, new Listener() {

		@Override
		public void handleEvent(org.eclipse.swt.widgets.Event event) {
			if (highlightNodes.getSelection())
				highlightNodesOnGraph(highlightNodes.getSelection());
		}
	});

	viewer.setContentProvider(new ArrayContentProvider());
	viewer.setInput(this.units);
	getSite().setSelectionProvider(viewer);

	GridData gridData = new GridData();
	gridData.verticalAlignment = GridData.FILL;
	gridData.horizontalSpan = 2;
	gridData.grabExcessHorizontalSpace = true;
	gridData.grabExcessVerticalSpace = true;
	gridData.horizontalAlignment = GridData.FILL;
	viewer.getControl().setLayoutData(gridData);

	Hashtable<String, Object> properties = new Hashtable<>();
	String[] topics = new String[] { DataModel.EA_TOPIC_DATA_SELECTION, DataModel.EA_TOPIC_DATA_UNIT_CHANGED, DataModel.EA_TOPIC_DATA_VIEW_REFRESH };
	properties.put(EventConstants.EVENT_TOPIC, topics);
	ServiceUtil.registerService(EventHandler.class, this, properties);

}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:35,代码来源:ResultView.java

示例13: createContents

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
@Override
protected Control createContents(Composite parent)
{
	Composite composite = new Composite(parent, SWT.NONE);

	initialize();

	createDescriptionLabel(composite);

	listViewer = new TableViewer(composite, SWT.TOP | SWT.BORDER);

	if( !project.isOpen() )
		listViewer.getControl().setEnabled(false);

	listViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
	listViewer.setContentProvider(new JarProjectContentProvider(project));
	listViewer.setComparator(new ViewerComparator());
	listViewer.setInput(project.getWorkspace());

	String regName = getPreferenceStore().getString(JPFClasspathPlugin.PREF_REGISTRY_NAME);
	if( !regName.isEmpty() )
	{
		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
		listViewer.setSelection(new StructuredSelection(root.getProject(regName)));
	}
	listViewer.addSelectionChangedListener(new ISelectionChangedListener()
	{
		@Override
		public void selectionChanged(SelectionChangedEvent event)
		{
			modified = true;
		}
	});
	applyDialogFont(composite);

	GridLayoutFactory.fillDefaults().generateLayout(composite);

	return composite;
}
 
开发者ID:equella,项目名称:Equella,代码行数:40,代码来源:JPFRepositoryPage.java

示例14: attachWidget

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
@Override
public void attachWidget(Composite container) {
	TableViewer tableViewer = new TableViewer(container, SWT.BORDER|SWT.CENTER | SWT.MULTI | SWT.FULL_SELECTION |SWT.H_SCROLL |SWT.V_SCROLL|SWT.RESIZE);
	tableViewer.setContentProvider(iStructuredContentProvider);
	tableViewer.setLabelProvider(iTableLabelProvider);
	jfaceWidgets = tableViewer;
	widget = tableViewer.getTable();
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:ELTTableViewer.java

示例15: createTableViewer

import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
public TableViewer createTableViewer(Composite composite, String[] prop,
		int[] bounds, int columnWidth,
		IStructuredContentProvider iStructuredContentProvider,
		ITableLabelProvider iTableLabelProvider) {
	final TableViewer tableViewer = new TableViewer(composite, SWT.BORDER
			| SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);

	Table table = tableViewer.getTable();
	table.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
	tableViewer.setContentProvider(iStructuredContentProvider);
	tableViewer.setLabelProvider(iTableLabelProvider);
	tableViewer.setColumnProperties(prop);
	tableViewer.getTable().addTraverseListener(new TraverseListener() {

		@Override
		public void keyTraversed(TraverseEvent e) {
			if (e.keyCode == SWT.ARROW_UP) {
				e.doit = false;
			} else if (e.keyCode == SWT.ARROW_DOWN) {
				e.doit = false;
			} else if (e.keyCode == SWT.TRAVERSE_ARROW_NEXT) {
				e.doit = false;
			} else if (e.keyCode == SWT.TRAVERSE_ARROW_PREVIOUS) {
				e.doit = false;
			}

		}
	});

	table.setVisible(true);
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	/*
	 * createTableColumns(table,prop, columnWidth); CellEditor[] editors
	 * =createCellEditorList(table,1); tableViewer.setCellEditors(editors);
	 */

	return tableViewer;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:40,代码来源:ELTSWTWidgets.java


注:本文中的org.eclipse.jface.viewers.TableViewer.setContentProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。