use of org.eclipse.search.ui.text.AbstractTextSearchResult in project eclipse.platform.text by eclipse.
the class MatchFilterSelectionAction method run.
@Override
public void run() {
Shell shell = fPage.getSite().getShell();
AbstractTextSearchResult input = fPage.getInput();
if (input == null) {
return;
}
MatchFilter[] allFilters = input.getAllMatchFilters();
MatchFilter[] checkedFilters = input.getActiveMatchFilters();
Integer limit = fPage.getElementLimit();
boolean enableMatchFilterConfiguration = checkedFilters != null;
boolean enableLimitConfiguration = limit != null;
int elementLimit = limit != null ? limit.intValue() : -1;
MatchFilterSelectionDialog dialog = new MatchFilterSelectionDialog(shell, enableMatchFilterConfiguration, allFilters, checkedFilters, enableLimitConfiguration, elementLimit);
if (dialog.open() == Window.OK) {
if (enableMatchFilterConfiguration) {
input.setActiveMatchFilters(dialog.getMatchFilters());
}
if (enableLimitConfiguration) {
fPage.setElementLimit(Integer.valueOf(dialog.getLimit()));
}
}
}
use of org.eclipse.search.ui.text.AbstractTextSearchResult in project erlide_eclipse by erlang.
the class SearchResultLabelProvider method getMatchCountText.
private StyledString getMatchCountText(final Object element) {
int matchCount = 0;
final AbstractTextSearchResult result = fPage.getInput();
if (result != null) {
matchCount = fPage.getDisplayedMatchCount(element);
}
if (matchCount > 1) {
final String countInfo = MessageFormat.format("({0} matches)", matchCount);
return new StyledString(countInfo, StyledString.COUNTER_STYLER);
}
return new StyledString();
}
Aggregations