Search in sources :

Example 1 with ISearchStrategy

use of org.eclipse.nebula.widgets.nattable.search.strategy.ISearchStrategy in project nebula.widgets.nattable by eclipse.

the class SearchDialog method createSearchCommand.

private SearchCommand createSearchCommand(String text, boolean isIncremental) {
    this.forwardValue = this.forwardButton.getSelection();
    this.allValue = this.allButton.getSelection();
    this.caseSensitiveValue = this.caseSensitiveButton.getSelection();
    this.wrapSearchValue = this.wrapSearchButton.getSelection();
    this.wholeWordValue = this.wholeWordButton.getSelection();
    this.incrementalValue = this.incrementalButton.getSelection();
    this.regexValue = this.regexButton.getSelection();
    // TODO
    // includeCollapsedValue = includeCollapsedButton.getSelection();
    this.columnFirstValue = this.columnFirstButton.getSelection();
    String searchDirection = this.forwardValue ? ISearchDirection.SEARCH_FORWARD : ISearchDirection.SEARCH_BACKWARDS;
    ISearchStrategy searchStrategy;
    if (this.allValue) {
        searchStrategy = new GridSearchStrategy(this.natTable.getConfigRegistry(), true, this.columnFirstValue);
    } else {
        searchStrategy = new SelectionSearchStrategy(this.natTable.getConfigRegistry(), this.columnFirstValue);
    }
    return new SearchCommand(text, this.natTable, searchStrategy, searchDirection, this.wrapSearchValue, this.caseSensitiveValue, !this.regexValue && this.wholeWordValue, !this.regexValue && this.allValue && isIncremental, this.regexValue, // includeCollapsedValue, comparator);
    false, this.comparator);
}
Also used : GridSearchStrategy(org.eclipse.nebula.widgets.nattable.search.strategy.GridSearchStrategy) ISearchStrategy(org.eclipse.nebula.widgets.nattable.search.strategy.ISearchStrategy) SearchCommand(org.eclipse.nebula.widgets.nattable.search.command.SearchCommand) SelectionSearchStrategy(org.eclipse.nebula.widgets.nattable.search.strategy.SelectionSearchStrategy)

Aggregations

SearchCommand (org.eclipse.nebula.widgets.nattable.search.command.SearchCommand)1 GridSearchStrategy (org.eclipse.nebula.widgets.nattable.search.strategy.GridSearchStrategy)1 ISearchStrategy (org.eclipse.nebula.widgets.nattable.search.strategy.ISearchStrategy)1 SelectionSearchStrategy (org.eclipse.nebula.widgets.nattable.search.strategy.SelectionSearchStrategy)1