本文整理匯總了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;
}