Search in sources :

Example 1 with IContributionService

use of org.eclipse.ui.model.IContributionService in project translationstudio8 by heartsome.

the class HsPreferenceDialog method createTreeAreaContents.

@Override
protected Control createTreeAreaContents(Composite parent) {
    // 创建左侧树
    Control result = super.createTreeAreaContents(parent);
    TreeViewer treeViewer = getTreeViewer();
    // 设置排序器
    IContributionService cs = (IContributionService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IContributionService.class);
    treeViewer.setComparator(cs.getComparatorFor(IContributionService.TYPE_PREFERENCE));
    // 展开所有
    treeViewer.expandAll();
    return result;
}
Also used : Control(org.eclipse.swt.widgets.Control) TreeViewer(org.eclipse.jface.viewers.TreeViewer) IContributionService(org.eclipse.ui.model.IContributionService)

Aggregations

TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 Control (org.eclipse.swt.widgets.Control)1 IContributionService (org.eclipse.ui.model.IContributionService)1