Package org.eclipse.nebula.widgets.nattable.search.strategy

Examples of org.eclipse.nebula.widgets.nattable.search.strategy.SelectionSearchStrategy


        ISearchStrategy searchStrategy;
        if (allValue) {
            searchStrategy = new GridSearchStrategy(
                    natTable.getConfigRegistry(), true, columnFirstValue);
        } else {
            searchStrategy = new SelectionSearchStrategy(
                    natTable.getConfigRegistry(), columnFirstValue);
        }
        return new SearchCommand(text, natTable, searchStrategy,
                searchDirection, wrapSearchValue, caseSensitiveValue,
                !regexValue && wholeWordValue, !regexValue && allValue
View Full Code Here


                        columnPosition, rowPosition, false, true));
            }
        }

        // We should get 20 Cells from the body
        SelectionSearchStrategy selectionStrategy = new SelectionSearchStrategy(
                configRegistry);
        PositionCoordinate[] cellsToSearch = selectionStrategy
                .getSelectedCells(gridLayer.getBodyLayer().getSelectionLayer());
        Assert.assertEquals(20, cellsToSearch.length);
    }
View Full Code Here

        Assert.assertEquals(5, gridLayer.getBodyLayer().getSelectionLayer()
                .getSelectedCellPositions().length);

        final SelectionLayer selectionLayer = gridLayer.getBodyLayer()
                .getSelectionLayer();
        SelectionSearchStrategy selectionStrategy = new SelectionSearchStrategy(
                configRegistry);
        selectionStrategy
                .setComparator(new CellValueAsStringComparator<Comparable<String>>());
        selectionStrategy.setContextLayer(selectionLayer);
        Assert.assertNull(selectionStrategy.executeSearch("[0,1]"));
        Assert.assertNotNull(selectionStrategy.executeSearch(CELL_VALUE));
        Assert.assertNotNull(selectionStrategy.executeSearch(CELL_VALUE));
        Assert.assertNull(selectionStrategy.executeSearch("[5,0]"));
    }
View Full Code Here

        gridLayer.doCommand(new SelectAllCommand());

        // Should find the first cell in grid
        final SelectionLayer selectionLayer = gridLayer.getBodyLayer()
                .getSelectionLayer();
        SelectionSearchStrategy selectionStrategy = new SelectionSearchStrategy(
                configRegistry);
        selectionStrategy
                .setComparator(new CellValueAsStringComparator<Comparable<String>>());
        selectionStrategy.setContextLayer(selectionLayer);

        PositionCoordinate positionCoordinate = selectionStrategy
                .executeSearch(CELL_VALUE);
        Assert.assertEquals(0, positionCoordinate.columnPosition);
        Assert.assertEquals(0, positionCoordinate.rowPosition);

        // Should find last cell
        selectionStrategy = new SelectionSearchStrategy(configRegistry,
                ISearchDirection.SEARCH_BACKWARDS, true);
        selectionStrategy
                .setComparator(new CellValueAsStringComparator<Comparable<String>>());
        selectionStrategy.setContextLayer(selectionLayer);

        positionCoordinate = selectionStrategy.executeSearch(CELL_VALUE);
        Assert.assertEquals(9, positionCoordinate.columnPosition);
        Assert.assertEquals(4, positionCoordinate.rowPosition);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.search.strategy.SelectionSearchStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.