Package org.eclipse.nebula.widgets.nattable.coordinate

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate


                .asList(cellsToSearch);
        String stringValue = caseSensitive ? valueToMatch.toString()
                : valueToMatch.toString().toLowerCase();
        Pattern pattern = regex ? Pattern.compile(stringValue) : null;
        for (int cellIndex = 0; cellIndex < cellCoordinates.size(); cellIndex++) {
            final PositionCoordinate cellCoordinate = cellCoordinates
                    .get(cellIndex);
            if (compare(layer, configRegistry, pattern, stringValue,
                    comparator, caseSensitive, wholeWord, regex,
                    cellCoordinate.columnPosition, cellCoordinate.rowPosition)) {
                return cellCoordinate;
View Full Code Here


        for (GridRectangle cellRectangle : cellRectangles) {
            int direction = cellRectangle.firstDim.size() > 0
                    || cellRectangle.secondDim.size() > 0 ? 1 : -1;
            for (int i = cellRectangle.firstDim.start; Math
                    .abs(cellRectangle.firstDim.end - i) > 0; i += direction) {
                PositionCoordinate result = findCell(layer, configRegistry, i,
                        cellRectangle.secondDim.start,
                        cellRectangle.secondDim.end, direction, pattern,
                        stringValue, comparator, caseSensitive, wholeWord,
                        regex, columnFirst, includeCollapsed);
                if (result != null) {
View Full Code Here

        }
        for (int i = secondDimStart; direction * (secondDimEnd - i) > 0; i += direction) {
            if (compare(layer, configRegistry, pattern, stringValue,
                    comparator, caseSensitive, wholeWord, regex,
                    columnPosition, rowPosition)) {
                return new PositionCoordinate(layer, columnPosition,
                        rowPosition);
            }
            if (columnFirst) {
                rowPosition += direction;
            } else {
View Full Code Here

        if (result != null && result instanceof SelectionLayer) {
            selectionLayer = (SelectionLayer) result;
        }

        // Pick the user's selection, if possible
        PositionCoordinate pos = getPosition();
        final String text = getTextForSelection(pos);
        selections.push(new SelectionItem(text, pos));
        findCombo.setText(text);
    }
View Full Code Here

        if (!(contextLayer instanceof SelectionLayer)) {
            throw new RuntimeException(
                    "For the GridSearchStrategy to work it needs the selectionLayer to be passed as the contextLayer."); //$NON-NLS-1$
        }
        SelectionLayer selectionLayer = (SelectionLayer) contextLayer;
        @SuppressWarnings("unchecked")
        PositionCoordinate coordinate = CellDisplayValueSearchUtil.findCell(
                selectionLayer, configRegistry,
                getSelectedCells(selectionLayer), valueToMatch,
                (Comparator<String>) getComparator(), isCaseSensitive(),
                isWholeWord(), isRegex(), isIncludeCollapsed());
View Full Code Here

        statusLabel.setText(""); //$NON-NLS-1$
        statusLabel.setForeground(null);
        if (selectionLayer != null) {
            // If the current selection is different, the user must have
            // clicked a new selection, and we need to update to that.
            PositionCoordinate pos = getPosition();
            if (!pos.equals(selections.peek().pos)) {
                selections.clear();
                selections
                        .push(new SelectionItem(getTextForSelection(pos), pos));
            }
        }
View Full Code Here

        BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {

            @Override
            public void run() {
                PositionCoordinate previous = new PositionCoordinate(selections
                        .peek().pos);
                try {
                    final SearchCommand searchCommand = createSearchCommand(
                            text, isIncremental);
                    final SearchEventListener searchEventListener = new SearchEventListener();
View Full Code Here

        });
    }

    private PositionCoordinate getPosition() {
        if (selectionLayer == null) {
            return new PositionCoordinate(null, SelectionLayer.NO_SELECTION,
                    SelectionLayer.NO_SELECTION);
        }
        // The SelectionLayer keeps its anchor even if it has no selection.
        // Seems wrong to me, so here I clear out the anchor.
        PositionCoordinate pos = new PositionCoordinate(
                selectionLayer.getSelectionAnchor());
        if (selectionLayer.getSelectedCellPositions().length == 0
                && pos.rowPosition != SelectionLayer.NO_SELECTION) {
            selectionLayer.clear(false);
            pos = new PositionCoordinate(selectionLayer.getSelectionAnchor());
        }
        return pos;
    }
View Full Code Here

        if (!(contextLayer instanceof SelectionLayer)) {
            throw new RuntimeException(
                    "For the GridSearchStrategy to work it needs the selectionLayer to be passed as the contextLayer."); //$NON-NLS-1$
        }
        SelectionLayer selectionLayer = (SelectionLayer) contextLayer;
        PositionCoordinate selectionAnchor = selectionLayer
                .getSelectionAnchor();
        boolean hadSelectionAnchor = selectionAnchor.columnPosition >= 0
                && selectionAnchor.rowPosition >= 0;
        if (!hadSelectionAnchor) {
            selectionAnchor.columnPosition = 0;
View Full Code Here

        String text;
        PositionCoordinate pos;

        SelectionItem(String text, PositionCoordinate pos) {
            this.text = text;
            this.pos = new PositionCoordinate(pos);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

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.