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


Java TreeViewer.addFilter方法代码示例

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


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

示例1: createDialogArea

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	CustomElementSelectionForm form = new CustomElementSelectionForm(parent, SWT.FILL);
	form.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

	TreeViewer v = form.getTreeViewer();
	for (ViewerFilter filter : filters) {
		v.addFilter(filter);
	}
	this.treeViewer = v;

	WorkbenchContentProvider contentProvider = new WorkbenchContentProvider();
	ILabelProvider labelProvider = new WorkbenchLabelProvider();

	this.treeViewer.setContentProvider(contentProvider);
	this.treeViewer.setLabelProvider(labelProvider);

	this.treeViewer.setComparator(new ViewerComparator());

	this.treeViewer.setAutoExpandLevel(this.getAutoExpandLevel());

	form.setElementLabel(this.elementLabel);

	this.elementNameInput = form.getElementInput();

	form.getElementInput().addPropertyChangeListener(new PropertyChangeListener() {

		@Override
		public void propertyChange(PropertyChangeEvent evt) {
			if (evt.getPropertyName().equals(SuffixText.TEXT_PROPERTY) ||
					evt.getPropertyName().equals(SuffixText.SUFFIX_PROPERTY)) {
				validateElementInput();
				elementInputChanged();
			}

		}
	});
	return form;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:40,代码来源:CustomElementSelectionDialog.java

示例2: createViewer

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
protected void createViewer() {
	FormLayout formLayout = new FormLayout();
	setLayout(formLayout);
	Composite con = new Composite(this, SWT.NONE);
	FormData topData = new FormData();
	topData.left = new FormAttachment(0,0);
	topData.right = new FormAttachment(100,0);
	topData.top = new FormAttachment(0,0);
	con.setLayoutData(topData);
	
	con.setLayout(new GridLayout(3,false));
	createTopArea(con);
	
	viewer = new TreeViewer(this, SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
       contentProvider = new PrefsContentProvider();
	viewer.setContentProvider(contentProvider);
       viewer.getTree().setHeaderVisible(true);
       viewer.getTree().setLinesVisible(true);
       FormData viewerData = new FormData();
       viewerData.top = new FormAttachment(con, 5);
       viewerData.bottom = new FormAttachment(100,0);
       viewerData.left = new FormAttachment(0,0);
       viewerData.right = new FormAttachment(100,0);
       viewer.getTree().setLayoutData(viewerData);
       viewerFilter = new PreferenceFilter();
	viewer.addFilter(viewerFilter);
	filterJob = new SetFilterJob(viewer, viewerFilter);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:29,代码来源:ViewerPage.java


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