Package com.sun.star.util

Examples of com.sun.star.util.XSearchable


     * searches the document for items in the format ">*<"
     * @return a vector containing the XTextRanges of the found items
     */
    private List searchFillInItems() {
        try {
            XSearchable 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 Vector(ia.getCount());
            for (int i = 0; i<ia.getCount(); i++) {
                try {
                    l.add((XTextRange)UnoRuntime.queryInterface(XTextRange.class,ia.getByIndex(i)));
View Full Code Here


            catch( Exception e ){
                log.println( "EXCEPTION: " + e);
            }
        }

        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 );

        log.println( "adding TextDocument as mod relation to environment" );
View Full Code Here

        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException( "Couldn't get a spreadsheet", e);
        }

        XSearchable xSearch = (XSearchable)
                        UnoRuntime.queryInterface(XSearchable.class,oSheet);

        oObj = xSearch.createSearchDescriptor();
        // create testobject here
        log.println("creating a new environment for object");
        TestEnvironment tEnv = new TestEnvironment(oObj);

        return tEnv;
View Full Code Here

        } catch (Exception Ex ) {
            Ex.printStackTrace(log);
            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() {
            public int compare(Object o1, Object o2) {
View Full Code Here

            catch( Exception e ){
                log.println( "EXCEPTION: " + e);
            }
        }

        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" );
View Full Code Here

        } catch (Exception Ex ) {
            Ex.printStackTrace(log);
            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() {
            public int compare(Object o1, Object o2) {
View Full Code Here

        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException( "Couldn't get a spreadsheet", e);
        }

        XSearchable xSearch = (XSearchable)
                        UnoRuntime.queryInterface(XSearchable.class,oSheet);

        oObj = xSearch.createSearchDescriptor();
        // create testobject here
        log.println("creating a new environment for object");
        TestEnvironment tEnv = new TestEnvironment(oObj);

        return tEnv;
View Full Code Here

        } catch (Exception Ex ) {
            Ex.printStackTrace(log);
            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() {
            public int compare(Object o1, Object o2) {
View Full Code Here

            catch( Exception e ){
                log.println( "EXCEPTION: " + e);
            }
        }

        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" );
View Full Code Here

     */
    private List searchFillInItems()
    {
        try
        {
            XSearchable 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 Vector(ia.getCount());
            for (int i = 0; i < ia.getCount(); i++)
            {
                try
View Full Code Here

TOP

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

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.