Package org.eclipse.search.ui.text

Examples of org.eclipse.search.ui.text.AbstractTextSearchResult


        final String label = super.getLabel();
        final StructuredViewer viewer = getViewer();
        if (viewer instanceof TableViewer) {
            final TableViewer tv = (TableViewer) viewer;

            final AbstractTextSearchResult result = getInput();
            if (result != null) {
                final int itemCount = ((IStructuredContentProvider) tv
                        .getContentProvider()).getElements(getInput()).length;
                final int fileCount = getInput().getElements().length;
                if (itemCount < fileCount) {
View Full Code Here


        }
    }

    private StyledString getMatchCountText(final Object element) {
        int matchCount = 0;
        final AbstractTextSearchResult result = fPage.getInput();
        if (result != null) {
            matchCount = fPage.getDisplayedMatchCount(element);
        }
        if (matchCount > 1) {
            final String countInfo = MessageFormat.format("({0} matches)",
View Full Code Here

    private void loadNewestQueryResult(ISearchQuery[] queries) {
        // new queries are added at first position
        ISearchQuery query = queries[0];
        ISearchResult searchResult = query.getSearchResult();
        if (searchResult instanceof AbstractTextSearchResult) {
            AbstractTextSearchResult res = (AbstractTextSearchResult) searchResult;
            onElementsAdded(asList(res.getElements()));
        }   
    }
View Full Code Here

    }

    public void onQueryRemoved(ISearchQuery query) {
        ISearchResult searchResult = query.getSearchResult();
        if (searchResult instanceof AbstractTextSearchResult) {
            AbstractTextSearchResult res = (AbstractTextSearchResult) searchResult;
            onElementsRemoved(asList(res.getElements()));
        }              
    }
View Full Code Here

        setEnabled(!(fElements.length == 0));
    }

    private IFile[] collectFiles(Iterator resources) {
        final Set files = new HashSet();
        final AbstractTextSearchResult result = fPage.getInput();
        if (result == null)
            return new IFile[0];
        while (resources.hasNext()) {
            IResource resource = (IResource) resources.next();
            try {
                resource.accept(new IResourceProxyVisitor() {
                    public boolean visit(IResourceProxy proxy) throws CoreException {
                        if (proxy.getType() == IResource.FILE) {
                            IResource file = proxy.requestResource();
                            if (result.getMatchCount(file) > 0) {
                                files.add(file);
                            }
                            return false;
                        }
                        return true;
View Full Code Here

    public FileTextSearchScope getSearchScope() {
        return fScope;
    }

    public IStatus run(final IProgressMonitor monitor) {
        AbstractTextSearchResult textResult = (AbstractTextSearchResult) getSearchResult();
        textResult.removeAll();

        Pattern searchPattern = getSearchPattern();
        boolean searchInBinaries = !isScopeAllFileTypes();

        TextSearchResultCollector collector = new TextSearchResultCollector(textResult, isFileNameSearch(),
View Full Code Here

        String label = super.getLabel();
        StructuredViewer viewer = getViewer();
        if (viewer instanceof TableViewer) {
            TableViewer tv = (TableViewer) viewer;

            AbstractTextSearchResult result = getInput();
            if (result != null) {
                int itemCount = ((IStructuredContentProvider) tv.getContentProvider()).getElements(getInput()).length;
                if (showLineMatches()) {
                    int matchCount = getInput().getMatchCount();
                    if (itemCount < matchCount) {
View Full Code Here

            }
        }
    }

    private boolean showLineMatches() {
        AbstractTextSearchResult input = getInput();
        return getLayout() == FLAG_LAYOUT_TREE && input != null
                && !((AbstractPythonSearchQuery) input.getQuery()).isFileNameSearch();
    }
View Full Code Here

        }
        return max;
    }

    private String getColoredLabelWithCounts(Object element, String coloredName) {
        AbstractTextSearchResult result = fPage.getInput();
        if (result == null)
            return coloredName;

        int matchCount = result.getMatchCount(element);
        if (matchCount <= 1)
            return coloredName;

        String countInfo = Messages.format(SearchMessages.FileLabelProvider_count_format, new Integer(matchCount));
        coloredName += " ";
View Full Code Here

TOP

Related Classes of org.eclipse.search.ui.text.AbstractTextSearchResult

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.