当前位置: 首页>>代码示例>>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;未经允许,请勿转载。