當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。