本文整理汇总了Java中org.eclipse.jface.viewers.StructuredViewer.getContentProvider方法的典型用法代码示例。如果您正苦于以下问题:Java StructuredViewer.getContentProvider方法的具体用法?Java StructuredViewer.getContentProvider怎么用?Java StructuredViewer.getContentProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.StructuredViewer
的用法示例。
在下文中一共展示了StructuredViewer.getContentProvider方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: select
import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
@Override
public boolean select(Viewer viewer, Object parentElement,
Object element) {
StructuredViewer sviewer = (StructuredViewer) viewer;
ITreeContentProvider provider = (ITreeContentProvider) sviewer
.getContentProvider();
if (element instanceof Group ) {
for (Object child: provider.getChildren(element)) {
if (select(viewer, element, child))
return true;
}
}
else {
Test test = (Test)element;
if (test.getTestName().contains(searchTestName)) {
return true;
}
}
return false;
}
示例2: select
import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof Variant || element instanceof Commentable || element instanceof SoftwareElement) {
return true;
} else if (element instanceof VariationPoint) {
return select((VariationPoint) element);
} else {
StructuredViewer sviewer = (StructuredViewer) viewer;
ITreeContentProvider provider = (ITreeContentProvider) sviewer.getContentProvider();
for (Object child : provider.getChildren(element)) {
if (select(viewer, element, child)) {
return true;
}
}
return false;
}
}
示例3: setGrouping
import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
/**
* Precondition here: the viewer must be showing a tree with a LevelContentProvider.
*
* @param grouping the grouping which must be one of the <code>LEVEL_*</code> constants from
* {@link LevelTreeContentProvider}
*/
void setGrouping(int grouping) {
fCurrentGrouping= grouping;
StructuredViewer viewer= getViewer();
LevelTreeContentProvider cp= (LevelTreeContentProvider) viewer.getContentProvider();
cp.setLevel(grouping);
updateGroupingActions();
getSettings().put(KEY_GROUPING, fCurrentGrouping);
getViewPart().updateLabel();
}
示例4: getFilteredMatchCount
import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
private int getFilteredMatchCount() {
StructuredViewer viewer= getViewer();
if (viewer instanceof TreeViewer) {
ITreeContentProvider tp= (ITreeContentProvider) viewer.getContentProvider();
return getMatchCount(tp, getRootElements((TreeViewer) getViewer()));
} else {
return getMatchCount((TableViewer) viewer);
}
}
示例5: getRawChildren
import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
private Object[] getRawChildren(StructuredViewer viewer, IPackageFragment fragment) {
IStructuredContentProvider provider = (IStructuredContentProvider) viewer.getContentProvider();
if (provider instanceof ITreeContentProvider) {
return ((ITreeContentProvider)provider).getChildren(fragment);
}
return provider.getElements(fragment);
}