本文整理汇总了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;
}
示例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 () ;
}
示例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;
}