本文整理匯總了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);
}