Package com.brosinski.eclipse.regex

Examples of com.brosinski.eclipse.regex.Match


        //getViewSite().getActionBars().getMenuManager().add(registerAction);
        getViewSite().getActionBars().getMenuManager().add(aboutAction);
    }

    public void selectNextMatch() {
        Match match = regex.getMatches().nextMatch();
        if (match != null) {
            StyledText searchText = txt_SearchText;
            StyledText resultText = txt_Result;
            searchText.setSelection(match.getStart(), match.getEnd());

            String resultStr = resultText.getText();
            Pattern patt = Pattern.compile("start=" + match.getStart()
                    + ", end=" + match.getEnd());
            Matcher matcher = patt.matcher(resultStr);
            if (matcher.find()) {
                resultText.setSelection(matcher.start(), matcher.end());
            }
        }
View Full Code Here


            }
        }
    }

    public void selectPreviousMatch() {
        Match match = regex.getMatches().prevMatch();

        if (match != null) {
            StyledText searchText = txt_SearchText;
            StyledText resultText = txt_Result;
            searchText.setSelection(match.getStart(), match.getEnd());
            String resultStr = resultText.getText();

            Pattern patt = Pattern.compile("start=" + match.getStart()
                    + ", end=" + match.getEnd());
            Matcher matcher = patt.matcher(resultStr);
            if (matcher.find()) {
                resultText.setSelection(matcher.start(), matcher.end());
            }
        }
View Full Code Here

        StyleRange[] styleRanges = new StyleRange[matches.getMatchCount()];
        int c = 0;

        for (Iterator i = matches.iterator(); i.hasNext();) {
            Match match = (Match) i.next();

            styleRanges[c++] = new StyleRange(match.getStart(), match.getEnd()
                    - match.getStart(), COLOR_RED, COLOR_WHITE);

            out.append("start=");
            out.append(match.getStart());
            out.append(", end=");
            out.append(match.getEnd());
            out.append("\n");
            for (Iterator groups = match.getGroups().iterator(); groups
                    .hasNext();) {
                Group group = (Group) groups.next();
                out.append("Group(");
                out.append(group.getIndex());
                out.append(") = ");
View Full Code Here

TOP

Related Classes of com.brosinski.eclipse.regex.Match

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.