Java 类org.eclipse.ui.model.IContributionService 实例源码

项目:translationstudio8    文件:ApplicationWorkbenchAdvisor.java   
/**
 * 对首选项菜单排序时,需要覆盖该方法
 */
public ContributionComparator getComparatorFor(String contributionType) {
    if (contributionType.equals(IContributionService.TYPE_PREFERENCE)) {
        return new PreferencesComparator();
    }
    else {
        return super.getComparatorFor(contributionType);
    }
}
项目:translationstudio8    文件:HsPreferenceDialog.java   
@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;
}
项目:tmxeditor8    文件:ApplicationWorkbenchAdvisor.java   
/**
 * 对首选项菜单排序时,需要覆盖该方法
 */
public ContributionComparator getComparatorFor(String contributionType) {
    if (contributionType.equals(IContributionService.TYPE_PREFERENCE)) {
        return new PreferencesComparator();
    } else {
        return super.getComparatorFor(contributionType);
    }
}
项目:tmxeditor8    文件:ApplicationWorkbenchAdvisor.java   
/**
 * 对首选项菜单排序时,需要覆盖该方法
 */
public ContributionComparator getComparatorFor(String contributionType) {
    if (contributionType.equals(IContributionService.TYPE_PREFERENCE)) {
        return new PreferencesComparator();
    }
    else {
        return super.getComparatorFor(contributionType);
    }
}
项目:tmxeditor8    文件:HsPreferenceDialog.java   
@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;
}
项目:maru    文件:ApplicationWorkbenchAdvisor.java   
@Override
public ContributionComparator getComparatorFor(String contributionType)
{
    if (contributionType.equals(IContributionService.TYPE_PROPERTY)) {
        return new MaruPropertyPageComparator();
    } else {
        return super.getComparatorFor(contributionType);
    }
}