本文整理汇总了Java中org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider类的典型用法代码示例。如果您正苦于以下问题:Java DecoratingStyledCellLabelProvider类的具体用法?Java DecoratingStyledCellLabelProvider怎么用?Java DecoratingStyledCellLabelProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DecoratingStyledCellLabelProvider类属于org.eclipse.jface.viewers包,在下文中一共展示了DecoratingStyledCellLabelProvider类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createStatusLabelProvider
import org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider; //导入依赖的package包/类
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();
}
};
}
开发者ID:SEMERU-WM,项目名称:ChangeScribe,代码行数:11,代码来源:FilesChangedListDialog.java
示例2: initializeViewer
import org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider; //导入依赖的package包/类
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;
}
}
}
}
}
}
});
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:56,代码来源:PlanSearchResultPage.java
注:本文中的org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论