/** * {@inheritDoc} */ @Override protected FilteredList createFilteredList(Composite parent) { FilteredList filteredList = super.createFilteredList(parent); if (fComparator != null) { filteredList.setComparator(fComparator); } return filteredList; }
public TypeNameMatch chooseImport(TypeNameMatch[] results, String containerName) { int nResults= results.length; if (nResults == 0) { return null; } else if (nResults == 1) { return results[0]; } if (containerName.length() != 0) { for (int i= 0; i < nResults; i++) { TypeNameMatch curr= results[i]; if (containerName.equals(curr.getTypeContainerName())) { return curr; } } } fIsShowing= true; ElementListSelectionDialog dialog= new ElementListSelectionDialog(fShell, new TypeNameMatchLabelProvider(TypeNameMatchLabelProvider.SHOW_FULLYQUALIFIED)) { @Override protected FilteredList createFilteredList(Composite parent) { FilteredList filteredList= super.createFilteredList(parent); filteredList.setComparator(ADD_IMPORT_COMPARATOR); return filteredList; } }; dialog.setTitle(JavaEditorMessages.AddImportOnSelection_dialog_title); dialog.setMessage(JavaEditorMessages.AddImportOnSelection_dialog_message); dialog.setElements(results); if (dialog.open() == Window.OK) { fIsShowing= false; TypeNameMatch result= (TypeNameMatch) dialog.getFirstResult(); QualifiedTypeNameHistory.remember(result.getFullyQualifiedName()); return result; } fIsShowing= false; return null; }
/** * {@inheritDoc} */ @Override protected FilteredList createFilteredList(Composite parent) { FilteredList filteredList= super.createFilteredList(parent); if (fComparator != null) { filteredList.setComparator(fComparator); } return filteredList; }
protected Control createDialogArea(Composite parent) { Composite contents = (Composite) super.createDialogArea(parent); createMessageArea(contents); createFilterText(contents); FilteredList createFilteredList = createFilteredList(contents); createFilteredList.setFilterMatcher(new MatchEveryWhereFilterMatcher()); setListElements(fElements); setSelection(getInitialElementSelections().toArray()); return contents; }