use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.
the class SearchGridCommandHandlerTest method shouldFindRegexInGrid.
@Test
public void shouldFindRegexInGrid() {
this.isForward = true;
this.isWrapSearch = false;
this.isCaseSensitive = false;
this.isWholeWord = false;
this.isIncremental = false;
this.isRegex = true;
this.isIncludeCollapsed = false;
this.isColumnFirst = true;
this.searchText = ".2.4.";
this.expected = new PositionCoordinate(null, 2, 4);
doTest();
}
use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.
the class SearchGridCommandHandlerTest method shouldFindRegexInRowFirst.
@Test
public void shouldFindRegexInRowFirst() {
this.isForward = true;
this.isWrapSearch = false;
this.isCaseSensitive = false;
this.isWholeWord = false;
this.isIncremental = false;
this.isRegex = true;
this.isIncludeCollapsed = false;
this.isColumnFirst = false;
this.searchText = ".[23].[23].";
this.expected = new PositionCoordinate(null, 3, 2);
doTest();
}
use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.
the class SearchGridCommandHandlerTest method shouldFindRegexInColumnFirst.
@Test
public void shouldFindRegexInColumnFirst() {
this.isForward = true;
this.isWrapSearch = false;
this.isCaseSensitive = false;
this.isWholeWord = false;
this.isIncremental = false;
this.isRegex = true;
this.isIncludeCollapsed = false;
this.isColumnFirst = true;
this.searchText = ".[23].[23].";
this.expected = new PositionCoordinate(null, 2, 3);
doTest();
}
use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.
the class GridSearchStrategyTest method searchShouldWrapAroundRow.
@Test
public void searchShouldWrapAroundRow() {
// Select search starting point in composite coordinates
this.gridLayer.doCommand(new SelectCellCommand(this.gridLayer, 3, 4, false, false));
GridSearchStrategy gridStrategy = new GridSearchStrategy(this.configRegistry, false, true);
gridStrategy.setComparator(new CellValueAsStringComparator<>());
// If we don't specify to wrap the search, it will not find it.
gridStrategy.setContextLayer(this.selectionLayer);
PositionCoordinate searchResult = gridStrategy.executeSearch("[1,3]");
assertNull(searchResult);
// Should find it when wrap search is enabled.
gridStrategy.setWrapSearch(true);
searchResult = gridStrategy.executeSearch("[1,3]");
assertNotNull(searchResult);
assertEquals(1, searchResult.columnPosition);
assertEquals(3, searchResult.rowPosition);
}
use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.
the class GridSearchStrategyTest method searchShouldNotFindWithSkipSearchLabel.
@Test
public void searchShouldNotFindWithSkipSearchLabel() {
GridSearchStrategy gridStrategy = new GridSearchStrategy(this.configRegistry, false, true);
// If we don't specify to wrap the search, it will not find it.
gridStrategy.setContextLayer(this.selectionLayer);
gridStrategy.setCaseSensitive(true);
gridStrategy.setComparator(new CellValueAsStringComparator<>());
PositionCoordinate searchResult = gridStrategy.executeSearch("body");
assertNotNull(searchResult);
assertEquals(2, searchResult.columnPosition);
assertEquals(2, searchResult.rowPosition);
// clear the selection
this.selectionLayer.clear();
// configure skip search label
ColumnOverrideLabelAccumulator accumulator = new ColumnOverrideLabelAccumulator(this.selectionLayer);
accumulator.registerColumnOverrides(2, ISearchStrategy.SKIP_SEARCH_RESULT_LABEL);
this.selectionLayer.setConfigLabelAccumulator(accumulator);
searchResult = gridStrategy.executeSearch("body");
assertNull(searchResult);
}
Aggregations