public void setActiveMatchFilters(MatchFilter[] filters) { super.setActiveMatchFilters(filters); JavaMatchFilter.setLastUsedFilters(filters); }
public void run() { AbstractTextSearchResult input= fPage.getInput(); if (input == null) { return; } ArrayList newFilters= new ArrayList(); MatchFilter[] activeMatchFilters= input.getActiveMatchFilters(); if (activeMatchFilters == null) { return; } for (int i= 0; i < activeMatchFilters.length; i++) { if (!activeMatchFilters[i].equals(fFilter)) { newFilters.add(activeMatchFilters[i]); } } boolean newState= isChecked(); if (newState) { newFilters.add(fFilter); } input.setActiveMatchFilters((MatchFilter[]) newFilters.toArray(new MatchFilter[newFilters.size()])); }
@Override public void run() { AbstractTextSearchResult input= fPage.getInput(); if (input == null) { return; } ArrayList<MatchFilter> newFilters= new ArrayList<>(); MatchFilter[] activeMatchFilters= input.getActiveMatchFilters(); if (activeMatchFilters == null) { return; } for (int i= 0; i < activeMatchFilters.length; i++) { if (!activeMatchFilters[i].equals(fFilter)) { newFilters.add(activeMatchFilters[i]); } } boolean newState= isChecked(); if (newState) { newFilters.add(fFilter); } input.setActiveMatchFilters(newFilters.toArray(new MatchFilter[newFilters.size()])); }
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(new Integer(dialog.getLimit())); } } }
@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())); } } }