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