当前位置: 首页>>代码示例>>Java>>正文


Java StructuredViewer.addFilter方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.StructuredViewer.addFilter方法的典型用法代码示例。如果您正苦于以下问题:Java StructuredViewer.addFilter方法的具体用法?Java StructuredViewer.addFilter怎么用?Java StructuredViewer.addFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.StructuredViewer的用法示例。


在下文中一共展示了StructuredViewer.addFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SearchCellLabelProvider

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
public SearchCellLabelProvider(final StructuredViewer structuredViewer) {
    if (hightLight == null) {
        hightLight = Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW);
    }
    if (builtInFont == null) {
        FontData[] fontData = structuredViewer.getControl().getFont().getFontData();
        fontData[0].setStyle(fontData[0].getStyle() | SWT.ITALIC);
        builtInFont = new Font(Display.getCurrent(), fontData[0]);
    }
    structuredViewer.addFilter(new ViewerFilter() {
        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
            if (!showBuiltIn && isBuiltIn(element)) {
                return false;
            }
            if (filterString == null || filterString.isEmpty()) {
                return true;
            }
            return getText(element).contains(filterString);
        }
    });
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:23,代码来源:SearchCellLabelProvider.java

示例2: fillFilters

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
public void fillFilters(StructuredViewer viewer) {
	ViewerFilter workingSetFilter= fFilterActionGroup.getWorkingSetFilter();
	if (fMode == SHOW_PROJECTS) {
		viewer.addFilter(workingSetFilter);
	} else {
		viewer.removeFilter(workingSetFilter);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:ViewActionGroup.java

示例3: execute

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
@Execute
public void execute(IEclipseContext context, @Active MPart activePart, @Active Shell shell, 
		@Named(BTSCoreConstants.OBJECTS_FILTER_BY_PARAM_ID) String param)
{
	filter = null;
	isContained = false;
	allObjects = null;
	
	Object o = activePart.getObject();
	StructuredViewerProvider part;
	// see if part has a StructuredViewer
	if (o instanceof StructuredViewerProvider)
	{
		part = (StructuredViewerProvider) o;
	}
	else
	{
		return;
	}
	
	// get viewer
	StructuredViewer viewer = part.getActiveStructuredViewer();
	
	if (viewer == null) return;
	
	// load param specific objects
	loadSpecificObjectsAndFilter(param, viewer, context);
	
	
	
	// make dialog
	ObjectByListEntrySelectionFilterDialog dialog = new ObjectByListEntrySelectionFilterDialog(shell, allObjects, filter);
	//inject projects and filter
	dialog.create();
	
	if (dialog.open() == dialog.OK)
	{
		filter = dialog.getFilter();
		// if no projects selected, drop filter, else add to viewer
		if (filter instanceof ViewerFilter) {
			if (filter.getObjects().isEmpty()) {
				viewer.removeFilter((ViewerFilter) filter);
			} else if (!isContained) {
				viewer.addFilter((ViewerFilter) filter);
			} else {
			}
			part.reloadViewerNodes(viewer);
		}
	}
	
}
 
开发者ID:cplutte,项目名称:bts,代码行数:52,代码来源:OpenObjectByListEntrySelectionFilterDialogHandler.java


注:本文中的org.eclipse.jface.viewers.StructuredViewer.addFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。