Java 类org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider 实例源码

项目:ChangeScribe    文件:FilesChangedListDialog.java   
private static CellLabelProvider createStatusLabelProvider() {
    CommitStatusLabelProvider baseProvider = new CommitStatusLabelProvider();
    ProblemLabelDecorator decorator = new ProblemLabelDecorator(null);
    return new DecoratingStyledCellLabelProvider(baseProvider, decorator, null) {
        @Override
        public String getToolTipText(Object element) {
            return ((ChangedFile) element).getChangeType();
        }
    };
}
项目:ChangeScribe    文件:DescribeVersionsDialog.java   
private static CellLabelProvider createStatusLabelProvider() {
    CommitStatusLabelProvider baseProvider = new CommitStatusLabelProvider();
    ProblemLabelDecorator decorator = new ProblemLabelDecorator(null);
    return new DecoratingStyledCellLabelProvider(baseProvider, decorator, null) {
        @Override
        public String getToolTipText(Object element) {
            return ((ChangedFile) element).getChangeType();
        }
    };
}
项目:ChangeScribe    文件:GenerateMessagePage.java   
private static CellLabelProvider createStatusLabelProvider() {
    CommitStatusLabelProvider baseProvider = new CommitStatusLabelProvider();
    ProblemLabelDecorator decorator = new ProblemLabelDecorator(null);
    return new DecoratingStyledCellLabelProvider(baseProvider, decorator, null) {
        @Override
        public String getToolTipText(Object element) {
            return ((ChangedFile) element).getChangeType();
        }
    };
}
项目:OpenSPIFe    文件:PlanSearchResultPage.java   
private void initializeViewer(ColumnViewer viewer, boolean flat) {
    this.viewer = viewer;

    // set content provider
    fContentProvider= new PlanSearchContentProvider(flat);
    viewer.setContentProvider(fContentProvider);

    // set label provider
    IStyledLabelProvider styleLabel = getStyledLabelProvider();
    ILabelDecorator labelDecorator = getLabelDecorator();
    viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(styleLabel, labelDecorator, null));
    viewer.setUseHashlookup(true);

    // set listeners
    viewer.addSelectionChangedListener(new ISelectionChangedListener(){
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection realSelect = (IStructuredSelection) event.getSelection();
            if (realSelect == null || realSelect.size() == 0){
                return;
            }           
            Object elem = realSelect.getFirstElement();
            if (elem instanceof EPlanElement){
                EPlan selectedPlan = EPlanUtils.getPlan((EPlanElement)elem);
                IWorkbench workbench = PlatformUI.getWorkbench();
                for (IWorkbenchWindow w : workbench.getWorkbenchWindows()) {
                    for (IWorkbenchPage p : w.getPages()) {
                        for (IEditorPart part : p.getEditors()) {
                            EPlan plan = CommonUtils.getAdapter(part, EPlan.class);
                            if (selectedPlan.equals(plan)){
                                //PlanEditorUtil.openPlanEditor(plan, w, true);
                                ISelectionProvider provider = part.getSite().getSelectionProvider();
                                provider.setSelection(realSelect);
                                IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
                                if(activeWorkbenchWindow != null) {
                                    IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
                                    if(activePage != null) {
                                        IViewPart searchView = activePage.findView("org.eclipse.search.ui.views.SearchView");
                                        if(searchView != null) {
                                            IWorkbenchPartSite site = searchView.getSite();
                                            Shell shell = site.getShell();
                                            shell.moveAbove(part.getSite().getShell());
                                        }

                                    }
                                }
                                return;
                            }
                        }
                    }
                }
            }
        }   
    });
}