本文整理汇总了Java中org.eclipse.jface.viewers.TableViewer.setSelection方法的典型用法代码示例。如果您正苦于以下问题:Java TableViewer.setSelection方法的具体用法?Java TableViewer.setSelection怎么用?Java TableViewer.setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.TableViewer
的用法示例。
在下文中一共展示了TableViewer.setSelection方法的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: 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;
}
示例3: selectionChanged
import org.eclipse.jface.viewers.TableViewer; //导入方法依赖的package包/类
@Override
public void selectionChanged(SelectionChangedEvent event) {
super.selectionChanged(event);
TreeSelection selection = (TreeSelection) event.getSelection();
PropertyElement propertyElement = (PropertyElement) selection.getFirstElement();
editor.setHighlightRange(propertyElement.getLineOffset(), 0, true);
TableViewer tableViewer = propEditor.getTableViewer();
StructuredSelection ss = new StructuredSelection(tableViewer.getElementAt(propertyElement
.getIndex()));
tableViewer.setSelection(ss, true);
}