當前位置: 首頁>>代碼示例>>Java>>正文


Java ComboViewer.addFilter方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.ComboViewer.addFilter方法的典型用法代碼示例。如果您正苦於以下問題:Java ComboViewer.addFilter方法的具體用法?Java ComboViewer.addFilter怎麽用?Java ComboViewer.addFilter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.ComboViewer的用法示例。


在下文中一共展示了ComboViewer.addFilter方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createSelectionViewer

import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createSelectionViewer(Composite parent, FormToolkit toolkit) {
	UI.formLabel(parent, toolkit, M.ReplaceFlow);
	ComboViewer viewer = new ComboViewer(new CCombo(parent, SWT.DROP_DOWN));
	decorateViewer(viewer);
	NameFilter filter = new NameFilter();
	viewer.addFilter(filter);
	viewer.setInput(usedInExchanges);
	UI.gridData(viewer.getCCombo(), true, false).widthHint = 300;
	viewer.getCCombo().addKeyListener(new FilterOnKey(viewer, filter, () -> usedInExchanges));
	viewer.addSelectionChangedListener((e) -> {
		FlowDescriptor selected = Viewers.getFirstSelected(viewer);
		if (selected == null || selected.getId() == 0l) {
			replacementCandidates = new ArrayList<>();
		} else {
			replacementCandidates = getReplacementCandidates(selected);
		}
		replacementViewer.setInput(replacementCandidates);
		updateButtons();
	});
	return viewer;
}
 
開發者ID:GreenDelta,項目名稱:olca-app,代碼行數:22,代碼來源:ReplaceFlowsDialog.java

示例2: createProcessViewer

import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createProcessViewer(Composite parent, FormToolkit toolkit) {
	UI.formLabel(parent, toolkit, M.ReplaceProvider);
	ComboViewer viewer = new ComboViewer(new CCombo(parent, SWT.DROP_DOWN));
	decorateViewer(viewer);
	viewer.setInput(usedInExchanges);
	NameFilter filter = new NameFilter();
	viewer.addFilter(filter);
	UI.gridData(viewer.getCCombo(), true, false).widthHint = 300;
	viewer.getCCombo().addKeyListener(new FilterOnKey(viewer, filter, () -> usedInExchanges));
	viewer.addSelectionChangedListener((e) -> {
		ProcessDescriptor selected = Viewers.getFirstSelected(viewer);
		if (selected == null || selected.getId() == 0l) {
			productViewer.setInput(new ArrayList<>());
		} else {
			productViewer.setInput(getProductOutputs(selected));
		}
		replacementCandidates = new ArrayList<>();
		replacementViewer.setInput(replacementCandidates);
		updateButtons();
	});
	return viewer;
}
 
開發者ID:GreenDelta,項目名稱:olca-app,代碼行數:23,代碼來源:ReplaceProvidersDialog.java

示例3: createReplacementViewer

import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createReplacementViewer(Composite parent, FormToolkit toolkit) {
	UI.formLabel(parent, toolkit, M.With);
	ComboViewer viewer = new ComboViewer(new CCombo(parent, SWT.NONE));
	decorateViewer(viewer);
	NameFilter filter = new NameFilter();
	viewer.addFilter(filter);
	viewer.getCCombo().addKeyListener(new FilterOnKey(viewer, filter, () -> replacementCandidates));
	UI.gridData(viewer.getCCombo(), true, false).widthHint = 300;
	viewer.addSelectionChangedListener((e) -> {
		updateButtons();
	});
	return viewer;
}
 
開發者ID:GreenDelta,項目名稱:olca-app,代碼行數:14,代碼來源:ReplaceFlowsDialog.java

示例4: createReplacementViewer

import org.eclipse.jface.viewers.ComboViewer; //導入方法依賴的package包/類
private ComboViewer createReplacementViewer(Composite parent, FormToolkit toolkit) {
	UI.formLabel(parent, toolkit, M.With);
	ComboViewer viewer = new ComboViewer(new CCombo(parent, SWT.NONE));
	decorateViewer(viewer);
	NameFilter filter = new NameFilter();
	viewer.addFilter(filter);
	UI.gridData(viewer.getCCombo(), true, false).widthHint = 300;
	viewer.getCCombo().addKeyListener(new FilterOnKey(viewer, filter, () -> replacementCandidates));
	viewer.addSelectionChangedListener((e) -> {
		updateButtons();
	});
	return viewer;
}
 
開發者ID:GreenDelta,項目名稱:olca-app,代碼行數:14,代碼來源:ReplaceProvidersDialog.java


注:本文中的org.eclipse.jface.viewers.ComboViewer.addFilter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。