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

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


    public boolean doCommand(ILayer targetLayer, SearchCommand searchCommand)
            throws PatternSyntaxException {
        searchCommand.convertToTargetLayer(targetLayer);

        AbstractSearchStrategy searchStrategy = (AbstractSearchStrategy) searchCommand
                .getSearchStrategy();
        final ILayerListener searchEventListener = searchCommand
                .getSearchEventListener();
        if (searchEventListener != null) {
            selectionLayer.addLayerListener(searchEventListener);
        }
        try {
            PositionCoordinate anchor = selectionLayer.getSelectionAnchor();
            if (anchor.columnPosition < 0 || anchor.rowPosition < 0) {
                anchor = new PositionCoordinate(selectionLayer, 0, 0);
            }
            searchStrategy.setContextLayer(targetLayer);
            Object dataValueToFind = null;
            if ((dataValueToFind = searchCommand.getSearchText()) == null) {
                dataValueToFind = selectionLayer.getDataValueByPosition(
                        anchor.columnPosition, anchor.rowPosition);
            }

            searchStrategy.setCaseSensitive(searchCommand.isCaseSensitive());
            searchStrategy.setWrapSearch(searchCommand.isWrapSearch());
            searchStrategy.setWholeWord(searchCommand.isWholeWord());
            searchStrategy.setIncremental(searchCommand.isIncremental());
            searchStrategy.setRegex(searchCommand.isRegex());
            searchStrategy.setIncludeCollapsed(searchCommand
                    .isIncludeCollapsed());
            searchStrategy.setSearchDirection(searchCommand
                    .getSearchDirection());
            searchStrategy.setComparator(searchCommand.getComparator());
            searchResultCellCoordinate = searchStrategy
                    .executeSearch(dataValueToFind);

            selectionLayer.fireLayerEvent(new SearchEvent(
                    searchResultCellCoordinate));
            if (searchResultCellCoordinate != null) {
View Full Code Here

TOP

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

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.