Examples of ISearchResult


Examples of ag.ion.noa.search.ISearchResult

    SearchDescriptor searchDescriptor = new SearchDescriptor(
        XMLArtefact.TAG_PATTERN);
    searchDescriptor.setIsCaseSensitive(false);
    searchDescriptor.setUseRegularExpression(true);
    ISearchResult searchResult = textDocument.getSearchService().findAll(
        searchDescriptor);

    List<IArtefactPosition> positions = new ArrayList<IArtefactPosition>();
    for (ITextRange textRange : searchResult.getTextRanges()) {
      OOArtefactPosition position = new TextPosition(ooDocument,
          textRange);
      positions.add(position);
    }
    return positions;
View Full Code Here

Examples of net.fp.rp.search.plugins.ISearchResult

                                countTopDocs,true);
                        }

                        //gather the results from all the plugins
                        for (int i = 0; i < plugins.length; i++) {
                            ISearchResult result = plugins[i].getResults();

                            //iterate over all the documents
                            double sumGroup = 0;

                            //sum for all the direct score of the nodes found it in the same set 
                            for (int j = 0; j < result.getDocuments().size();
                                    j++) {
                                DocumStruct doc = (DocumStruct) result.getDocuments()
                                                                      .get(j);

                                sumGroup = sumGroup +
                                    PluginManager.getCategoryStores()
                                                 .getDirectScore(doc.getCategoryName(),
                                        doc.getId());
                            }

                            //calculate the average
                            double average = 0.0;

                            if (result.getDocuments().size() > 0) {
                                average = sumGroup / result.getDocuments().size();
                            }

                            //case of "term AND categoryname:X" and set of term < set of categoryname:X (1 category in the system)
                            //store the new average score for each document in the set
                            for (int j = 0; j < result.getDocuments().size();
                                    j++) {
                                DocumStruct doc = (DocumStruct) result.getDocuments()
                                                                      .get(j);

                                //create a new document set and it to the list
                                listLinks.add(new DocumSetStruct(
                                        doc.getCategoryName(), doc.getId(),
View Full Code Here

Examples of net.fp.rp.search.plugins.ISearchResult

            int countErrors = 0;
            int countHits = 0;
            List allDocs = new ArrayList();

            for (int i = 0; i < plugins.length; i++) {
                ISearchResult result = plugins[i].getResults();
                countHits = countHits + result.getCountFound();
                countErrors = countErrors + result.getCountErrors();
                allDocs.addAll(result.getDocuments());
            }

            if (allDocs.size() > 0) {
                //we found documents (maybe with errors
                myModel.put(ModelView.STARTNO, "1");
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ISearchResult

            {
                Object data = item.getData();

                if ( data instanceof ISearchResult )
                {
                    ISearchResult sr = ( ISearchResult ) data;

                    item.getFont();
                    viewer.getTable().getColumn( 0 ).getWidth();
                    viewer.getTable().getItemHeight();

                    // dnLink.setText("<a>"+sr.getDn().toString()+"</a>");
                    dnLink.setData( sr );
                    dnLink.setText( sr.getDn().toString() );
                    dnLink.setUnderlined( true );
                    dnLink.setFont( item.getFont() );
                    dnLink.setForeground( item.getForeground() );
                    dnLink.setBackground( item.getBackground() );
                    dnLink.setBounds( item.getBounds( 0 ) );
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ISearchResult

            objectToSelect = search;
        }
        if ( obj instanceof ISearchResult )
        {
            ISearchResult searchResult = ( ISearchResult ) obj;
            ISearch search = searchResult.getSearch();

            universalListener.setInput( search.getConnection() );

            mainWidget.getViewer().expandToLevel( search, 1 );
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ISearchResult

                        select( entry );

                    }
                    else if ( obj instanceof ISearchResult )
                    {
                        ISearchResult sr = ( ISearchResult ) obj;
                        ISearch search = sr.getSearch();
                        select( search );
                    }
                    return true;
                }
            };
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ISearchResult

            {
                return greaterThan();
            }
            else
            {
                ISearchResult sr1 = ( ISearchResult ) o1;
                ISearchResult sr2 = ( ISearchResult ) o2;

                int cat1 = category( sr1 );
                int cat2 = category( sr2 );
                if ( cat1 != cat2 )
                {
                    return cat1 - cat2;
                }
                else if ( preferences.getSortBy() == BrowserCoreConstants.SORT_BY_NONE )
                {
                    return equal();
                }
                else if ( preferences.getSortBy() == BrowserCoreConstants.SORT_BY_RDN )
                {
                    return compareRdns( sr1.getEntry(), sr2.getEntry() );
                }
                else if ( preferences.getSortBy() == BrowserCoreConstants.SORT_BY_RDN_VALUE )
                {
                    return compareRdnValues( sr1.getEntry(), sr2.getEntry() );
                }
                else
                {
                    return equal();
                }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ISearchResult

            IBookmark bookmark = ( IBookmark ) obj;
            return bookmark.getName();
        }
        else if ( obj instanceof ISearchResult )
        {
            ISearchResult sr = ( ISearchResult ) obj;

            if ( !sr.getSearch().getConnection().equals( sr.getEntry().getConnection() ) )
            {
                return sr.getEntry().getUrl().toString();
            }
            else if ( sr.getEntry().hasParententry() || sr.getEntry() instanceof IRootDSE )
            {
                String label = "";
                if ( sr.getEntry() instanceof IRootDSE )
                {
                    label = "Root DSE";
                }
                else if ( preferences.getSearchResultLabel() == BrowserCommonConstants.SHOW_DN )
                {
                    label = sr.getEntry().getDn().toString();
                }
                else if ( preferences.getSearchResultLabel() == BrowserCommonConstants.SHOW_RDN )
                {
                    label = sr.getEntry().getRdn().toString();
                }
                else if ( preferences.getSearchResultLabel() == BrowserCommonConstants.SHOW_RDN_VALUE )
                {
                    label = sr.getEntry().getRdn().getValue();
                }

                if ( preferences.isSearchResultAbbreviate()
                    && label.length() > preferences.getSearchResultAbbreviateMaxLength() )
                {
                    label = Utils.shorten( label, preferences.getSearchResultAbbreviateMaxLength() );
                }

                return label;
            }
            else
            {
                return sr.getEntry().getDn().toString();
            }

        }
        else if ( obj instanceof BrowserCategory )
        {
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ISearchResult

        {
            return BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_BOOKMARK );
        }
        else if ( obj instanceof ISearchResult )
        {
            ISearchResult sr = ( ISearchResult ) obj;
            IEntry entry = sr.getEntry();
            return getImageByRdn( entry );
        }
        else if ( obj instanceof BrowserCategory )
        {
            BrowserCategory category = ( BrowserCategory ) obj;
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

            objectToSelect = search;
        }
        if ( obj instanceof ISearchResult )
        {
            ISearchResult searchResult = ( ISearchResult ) obj;
            ISearch search = searchResult.getSearch();

            universalListener.setInput( search.getBrowserConnection() );

            mainWidget.getViewer().expandToLevel( search, 1 );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.