本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}