Examples of XDispatchRecorder


Examples of com.sun.star.frame.XDispatchRecorder

        boolean res = true,
                locRes = true;
        log.print("Setting custom macro recorder ...");
        oObj.setDispatchRecorder(new MyRecorder());
        XDispatchRecorder rec = oObj.getDispatchRecorder();

        locRes = rec != null &&
            "MyRecorder implementation".equals(rec.getRecordedMacro());
        if (locRes) log.println("OK");
        else log.println("FAILED");
        res &= locRes;

        log.print("Setting null dispatch recorder ...");
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

    public TestEnvironment createTestEnvironment( TestParameters Param,
        PrintWriter log ) throws StatusException {

        XInterface oObj = null;
        XFrame xFrame = null;
        XDispatchRecorder xDR = null;

        try {
            SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
            oDoc = SOF.createTextDoc(null);
            try {
                Thread.sleep(1000);
            }
            catch (InterruptedException ex) {
            }
           
            XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc);
            xFrame = model.getCurrentController().getFrame();

            XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, xFrame);
            XDispatchRecorderSupplier xDRS = null;
            xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject(
                             new Type(XDispatchRecorderSupplier.class),
                          xFramePS.getPropertyValue("DispatchRecorderSupplier"));
            if (xDRS == null) {

                Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorderSupplier");
                xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS);
                xDRS = (XDispatchRecorderSupplier)
                    UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS);
            }

            xDR = xDRS.getDispatchRecorder();
            if (xDR != null) {
                oObj = xDR;
            } else {
                oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorder");
                xDR = (XDispatchRecorder) UnoRuntime.queryInterface
                    (XDispatchRecorder.class, oObj);
                xDRS.setDispatchRecorder(xDR);
            }
        } catch (com.sun.star.uno.Exception e) {
            throw new StatusException("Can't create component", e);
        }


        // fill recorder with content. It's needed for XIndexReplace
        URL dispURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertDateField");
        PropertyValue prop = new PropertyValue();
        prop.Name = "Text";
        prop.Value = "XDispatchRecorder.recordDispatch()";
        PropertyValue[] dispArgs = new PropertyValue[] {prop};
        xDR.recordDispatch(dispURL, dispArgs);


        TestEnvironment tEnv = new TestEnvironment( oObj );

        // INSTANCEn : _XIndexReplace
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

    public TestEnvironment createTestEnvironment( TestParameters Param,
        PrintWriter log ) throws StatusException {

        XInterface oObj = null;
        XFrame xFrame = null;
        XDispatchRecorder xDR = null;

        try {
            SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
            oDoc = SOF.createTextDoc(null);
            try {
                Thread.sleep(1000);
            }
            catch (InterruptedException ex) {
            }
           
            XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc);
            xFrame = model.getCurrentController().getFrame();

            XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, xFrame);
            XDispatchRecorderSupplier xDRS = null;
            xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject(
                             new Type(XDispatchRecorderSupplier.class),
                          xFramePS.getPropertyValue("DispatchRecorderSupplier"));
            if (xDRS == null) {

                Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorderSupplier");
                xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS);
                xDRS = (XDispatchRecorderSupplier)
                    UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS);
            }

            xDR = xDRS.getDispatchRecorder();
            if (xDR != null) {
                oObj = xDR;
            } else {
                oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorder");
                xDR = (XDispatchRecorder) UnoRuntime.queryInterface
                    (XDispatchRecorder.class, oObj);
                xDRS.setDispatchRecorder(xDR);
            }
        } catch (com.sun.star.uno.Exception e) {
            throw new StatusException("Can't create component", e);
        }


        // fill recorder with content. It's needed for XIndexReplace
        URL dispURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertDateField");
        PropertyValue prop = new PropertyValue();
        prop.Name = "Text";
        prop.Value = "XDispatchRecorder.recordDispatch()";
        PropertyValue[] dispArgs = new PropertyValue[] {prop};
        xDR.recordDispatch(dispURL, dispArgs);


        TestEnvironment tEnv = new TestEnvironment( oObj );

        // INSTANCEn : _XIndexReplace
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

        boolean res = true,
                locRes = true;
        log.print("Setting custom macro recorder ...");
        oObj.setDispatchRecorder(new MyRecorder());
        XDispatchRecorder rec = oObj.getDispatchRecorder();

        locRes = rec != null &&
            "MyRecorder implementation".equals(rec.getRecordedMacro());
        if (locRes) log.println("OK");
        else log.println("FAILED");
        res &= locRes;

        log.print("Setting null dispatch recorder ...");
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

    public TestEnvironment createTestEnvironment( TestParameters Param,
        PrintWriter log ) throws StatusException {

        XInterface oObj = null;
        XFrame xFrame = null;
        XDispatchRecorder xDR = null;

        try {
            SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
            oDoc = SOF.createTextDoc(null);
            try {
                Thread.sleep(1000);
            }
            catch (InterruptedException ex) {
            }
           
            XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc);
            xFrame = model.getCurrentController().getFrame();

            XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, xFrame);
            XDispatchRecorderSupplier xDRS = null;
            xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject(
                             new Type(XDispatchRecorderSupplier.class),
                          xFramePS.getPropertyValue("DispatchRecorderSupplier"));
            if (xDRS == null) {

                Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorderSupplier");
                xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS);
                xDRS = (XDispatchRecorderSupplier)
                    UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS);
            }

            xDR = xDRS.getDispatchRecorder();
            if (xDR != null) {
                oObj = xDR;
            } else {
                oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorder");
                xDR = (XDispatchRecorder) UnoRuntime.queryInterface
                    (XDispatchRecorder.class, oObj);
                xDRS.setDispatchRecorder(xDR);
            }
        } catch (com.sun.star.uno.Exception e) {
            throw new StatusException("Can't create component", e);
        }


        // fill recorder with content. It's needed for XIndexReplace
        URL dispURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertDateField");
        PropertyValue prop = new PropertyValue();
        prop.Name = "Text";
        prop.Value = "XDispatchRecorder.recordDispatch()";
        PropertyValue[] dispArgs = new PropertyValue[] {prop};
        xDR.recordDispatch(dispURL, dispArgs);


        TestEnvironment tEnv = new TestEnvironment( oObj );

        // INSTANCEn : _XIndexReplace
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

        boolean res = true,
                locRes = true;
        log.print("Setting custom macro recorder ...");
        oObj.setDispatchRecorder(new MyRecorder());
        XDispatchRecorder rec = oObj.getDispatchRecorder();

        locRes = rec != null &&
            "MyRecorder implementation".equals(rec.getRecordedMacro());
        if (locRes) log.println("OK");
        else log.println("FAILED");
        res &= locRes;

        log.print("Setting null dispatch recorder ...");
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

    public TestEnvironment createTestEnvironment( TestParameters Param,
        PrintWriter log ) throws StatusException {

        XInterface oObj = null;
        XFrame xFrame = null;
        XDispatchRecorder xDR = null;

        try {
            SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
            oDoc = SOF.createTextDoc(null);
            try {
                Thread.sleep(1000);
            }
            catch (InterruptedException ex) {
            }
           
            XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc);
            xFrame = model.getCurrentController().getFrame();

            XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, xFrame);
            XDispatchRecorderSupplier xDRS = null;
            xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject(
                             new Type(XDispatchRecorderSupplier.class),
                          xFramePS.getPropertyValue("DispatchRecorderSupplier"));
            if (xDRS == null) {

                Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorderSupplier");
                xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS);
                xDRS = (XDispatchRecorderSupplier)
                    UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS);
            }

            xDR = xDRS.getDispatchRecorder();
            if (xDR != null) {
                oObj = xDR;
            } else {
                oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorder");
                xDR = (XDispatchRecorder) UnoRuntime.queryInterface
                    (XDispatchRecorder.class, oObj);
                xDRS.setDispatchRecorder(xDR);
            }
        } catch (com.sun.star.uno.Exception e) {
            throw new StatusException("Can't create component", e);
        }


        // fill recorder with content. It's needed for XIndexReplace
        URL dispURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertDateField");
        PropertyValue prop = new PropertyValue();
        prop.Name = "Text";
        prop.Value = "XDispatchRecorder.recordDispatch()";
        PropertyValue[] dispArgs = new PropertyValue[] {prop};
        xDR.recordDispatch(dispURL, dispArgs);


        TestEnvironment tEnv = new TestEnvironment( oObj );

        // INSTANCEn : _XIndexReplace
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

        boolean res = true,
                locRes = true;
        log.print("Setting custom macro recorder ...");
        oObj.setDispatchRecorder(new MyRecorder());
        XDispatchRecorder rec = oObj.getDispatchRecorder();

        locRes = rec != null &&
            "MyRecorder implementation".equals(rec.getRecordedMacro());
        if (locRes) log.println("OK");
        else log.println("FAILED");
        res &= locRes;

        log.print("Setting null dispatch recorder ...");
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

    public TestEnvironment createTestEnvironment( TestParameters Param,
        PrintWriter log ) throws StatusException {

        XInterface oObj = null;
        XFrame xFrame = null;
        XDispatchRecorder xDR = null;

        try {
            SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)Param.getMSF());
            oDoc = SOF.createTextDoc(null);
            try {
                Thread.sleep(1000);
            }
            catch (InterruptedException ex) {
            }
           
            XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc);
            xFrame = model.getCurrentController().getFrame();

            XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, xFrame);
            XDispatchRecorderSupplier xDRS = null;
            xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject(
                             new Type(XDispatchRecorderSupplier.class),
                          xFramePS.getPropertyValue("DispatchRecorderSupplier"));
            if (xDRS == null) {

                Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorderSupplier");
                xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS);
                xDRS = (XDispatchRecorderSupplier)
                    UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS);
            }

            xDR = xDRS.getDispatchRecorder();
            if (xDR != null) {
                oObj = xDR;
            } else {
                oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
                    "com.sun.star.comp.framework.DispatchRecorder");
                xDR = (XDispatchRecorder) UnoRuntime.queryInterface
                    (XDispatchRecorder.class, oObj);
                xDRS.setDispatchRecorder(xDR);
            }
        } catch (com.sun.star.uno.Exception e) {
            throw new StatusException("Can't create component", e);
        }


        // fill recorder with content. It's needed for XIndexReplace
        URL dispURL = utils.parseURL((XMultiServiceFactory) Param.getMSF(), ".uno:InsertDateField");
        PropertyValue prop = new PropertyValue();
        prop.Name = "Text";
        prop.Value = "XDispatchRecorder.recordDispatch()";
        PropertyValue[] dispArgs = new PropertyValue[] {prop};
        xDR.recordDispatch(dispURL, dispArgs);


        TestEnvironment tEnv = new TestEnvironment( oObj );

        // INSTANCEn : _XIndexReplace
View Full Code Here

Examples of com.sun.star.frame.XDispatchRecorder

        boolean res = true,
                locRes = true;
        log.print("Setting custom macro recorder ...");
        oObj.setDispatchRecorder(new MyRecorder());
        XDispatchRecorder rec = oObj.getDispatchRecorder();

        locRes = rec != null &&
            "MyRecorder implementation".equals(rec.getRecordedMacro());
        if (locRes) log.println("OK");
        else log.println("FAILED");
        res &= locRes;

        log.print("Setting null dispatch recorder ...");
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.