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


Java TableViewer.setComparator方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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


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