Package com.sun.star.util

Examples of com.sun.star.util.XSearchDescriptor


            throw new StatusException("Couldn't insert text table ", Ex);
        }

        XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface
            (XSearchable.class, xTextDoc);
        XSearchDescriptor xSDesc = oSearch.createSearchDescriptor();
        xSDesc.setSearchString("SwXTextRanges");
        XIndexAccess textRanges1 = oSearch.findAll(xSDesc);

        xSDesc.setSearchString("bla");
        XIndexAccess textRanges2 = oSearch.findAll(xSDesc);

        tEnv.addObjRelation("Selections", new Object[] {
            oFrame1, oFrame2, textRanges1, textRanges2});
        tEnv.addObjRelation("Comparer", new Comparator() {
View Full Code Here


            }
        }

        XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface
            (XSearchable.class, xTextDoc);
        XSearchDescriptor xSDesc = oSearch.createSearchDescriptor();
        xSDesc.setSearchString("SwXTextRanges");

        oObj = oSearch.findAll(xSDesc);

        log.println( "creating a new environment for textrange object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );
View Full Code Here

    private List searchFillInItems()
    {
        try
        {
            XSearchable xSearchable = UnoRuntime.queryInterface(XSearchable.class, document);
            XSearchDescriptor sd = xSearchable.createSearchDescriptor();
            sd.setSearchString("<[^>]+>");
            sd.setPropertyValue("SearchRegularExpression", Boolean.TRUE);
            sd.setPropertyValue("SearchWords", Boolean.TRUE);

            XIndexAccess ia = xSearchable.findAll(sd);

            List l = new ArrayList<XTextRange>(ia.getCount());
            for (int i = 0; i < ia.getCount(); i++)
View Full Code Here

            }
        }

        XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface
            (XSearchable.class, xTextDoc);
        XSearchDescriptor xSDesc = oSearch.createSearchDescriptor();
        xSDesc.setSearchString("SwXTextRanges");

        oObj = oSearch.findAll(xSDesc);

        log.println( "creating a new environment for textrange object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );
View Full Code Here

            }
        }

        XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface
            (XSearchable.class, xTextDoc);
        XSearchDescriptor xSDesc = oSearch.createSearchDescriptor();
        xSDesc.setSearchString("SwXTextSearch");

        oObj = xSDesc;

        log.println( "creating a new environment for TextSearch object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );
View Full Code Here

     * </ul>
     */
    public void _replaceAll() {
        requiredMethod("createReplaceDescriptor()");
        oObj.replaceAll(Rdesc);
        XSearchDescriptor SDesc = oObj.createSearchDescriptor();
        SDesc.setSearchString("**");
        boolean res = (oObj.findFirst(SDesc) != null);
        // redo replacement
        Rdesc.setSearchString(mReplaceString);
        Rdesc.setReplaceString(mSearchString);
        oObj.replaceAll(Rdesc);
View Full Code Here

   *
   * @author Andreas Br�ker
   * @date 09.07.2006
   */
  protected XSearchDescriptor toXSearchDescriptor(ISearchDescriptor searchDescriptor) {
    XSearchDescriptor xSearchDescriptor = xSearchable.createSearchDescriptor();
    xSearchDescriptor.setSearchString(searchDescriptor.getSearchContent());
    if(searchDescriptor.isCaseSensitive()) {
      try {
        xSearchDescriptor.setPropertyValue("SearchCaseSensitive", Boolean.TRUE);
      }
      catch(Throwable throwable) {
        //do not consume
      }
    }
    if(searchDescriptor.useCompleteWords()) {
      try {
        xSearchDescriptor.setPropertyValue("SearchWords", Boolean.TRUE);
      }
      catch(Throwable throwable) {
        //do not consume
      }
    }
    if(searchDescriptor.useRegularExpression()) {
      try {
        xSearchDescriptor.setPropertyValue("SearchRegularExpression", Boolean.TRUE);
      }
      catch(Throwable throwable) {
        //do not consume
      }
    }
    if(searchDescriptor.useSimilaritySearch()) {
      try {
        xSearchDescriptor.setPropertyValue("SearchSimilarity", Boolean.TRUE);
      }
      catch(Throwable throwable) {
        //do not consume
      }
    }
View Full Code Here

   * @author Andreas Br�ker
   * @date 09.07.2006
   */
  protected XSearchDescriptor toXSearchDescriptor(
      ISearchDescriptor searchDescriptor) {
    XSearchDescriptor xSearchDescriptor = xSearchable
        .createSearchDescriptor();
    xSearchDescriptor.setSearchString(searchDescriptor.getSearchContent());
    if (searchDescriptor.isCaseSensitive()) {
      try {
        xSearchDescriptor.setPropertyValue("SearchCaseSensitive",
            Boolean.TRUE);
      } catch (Throwable throwable) {
        // do not consume
      }
    }
    if (searchDescriptor.useCompleteWords()) {
      try {
        xSearchDescriptor.setPropertyValue("SearchWords", Boolean.TRUE);
      } catch (Throwable throwable) {
        // do not consume
      }
    }
    if (searchDescriptor.useRegularExpression()) {
      try {
        xSearchDescriptor.setPropertyValue("SearchRegularExpression",
            Boolean.TRUE);
      } catch (Throwable throwable) {
        // do not consume
      }
    }
    if (searchDescriptor.useSimilaritySearch()) {
      try {
        xSearchDescriptor.setPropertyValue("SearchSimilarity",
            Boolean.TRUE);
      } catch (Throwable throwable) {
        // do not consume
      }
    }
View Full Code Here

     * @throws com.haulmont.yarg.exception.ReportingException If there is not appropriate band or alias is bad
     */
    protected void replaceAllAliasesInDocument() {
        XTextDocument xTextDocument = as(XTextDocument.class, xComponent);
        XReplaceable xReplaceable = as(XReplaceable.class, xTextDocument);
        XSearchDescriptor searchDescriptor = xReplaceable.createSearchDescriptor();
        searchDescriptor.setSearchString(ALIAS_WITH_BAND_NAME_REGEXP);
        try {
            searchDescriptor.setPropertyValue(SEARCH_REGULAR_EXPRESSION, true);
        } catch (Exception e) {
            throw new OpenOfficeException("An error occurred while setting search properties in Open office", e);
        }

        XIndexAccess indexAccess = xReplaceable.findAll(searchDescriptor);
View Full Code Here

            }
        }

        XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface
            (XSearchable.class, xTextDoc);
        XSearchDescriptor xSDesc = oSearch.createSearchDescriptor();
        xSDesc.setSearchString("SwXTextSearch");

        oObj = xSDesc;

        log.println( "creating a new environment for TextSearch object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );
View Full Code Here

TOP

Related Classes of com.sun.star.util.XSearchDescriptor

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.