Examples of XComponent


Examples of com.sun.star.lang.XComponent

        log.println("BoundsX= "+accC.getBounds().X);
        log.println("BoundsY= "+accC.getBounds().Y);
        log.println("BoundsWidth= "+accC.getBounds().Width);
        log.println("BoundsHeight= "+accC.getBounds().Height);

        XComponent xComp = (XComponent)UnoRuntime.queryInterface(
                                        XComponent.class, xSpreadsheetDoc);
        xComp.dispose();

    }
View Full Code Here

Examples of com.sun.star.lang.XComponent

     * are accessible.
     */
    public void checkPreviewShape() {
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
        XSpreadsheetDocument xSpreadsheetDoc = null;
        XComponent xComp = null;
        XInterface oObj = null;

        try {
            String docName = "calcshapes.sxc";
            log.println("Loading a spreadsheetdocument.");
            String url = utils.getFullURL(
                        (String)param.get("TestDocumentPath") + "/" + docName);
            log.println("loading document '" + url + "'");
            xComp = SOF.loadDocument(url);

        } catch (com.sun.star.uno.Exception e) {
            failed(e.getMessage());
            return;
        }

        try {
            Thread.currentThread().sleep(500) ;
        } catch (InterruptedException e) {
            System.out.println("While waiting :" + e) ;
        }

        if (xComp == null) {
            failed("loading document failed.");
            return;
        }

        xSpreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface(
                                            XSpreadsheetDocument.class, xComp);
        XModel aModel = (XModel)
            UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);

        XController xController = aModel.getCurrentController();

        // switching to 'Page Preview' mode
        try {
            XDispatchProvider xDispProv = (XDispatchProvider)
                UnoRuntime.queryInterface(XDispatchProvider.class, xController);
            XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
                UnoRuntime.queryInterface(XURLTransformer.class,
            mXMSF.createInstance("com.sun.star.util.URLTransformer"));
            // Because it's an in/out parameter we must use an
            // array of URL objects.
            URL[] aParseURL = new URL[1];
            aParseURL[0] = new URL();
            aParseURL[0].Complete = ".uno:PrintPreview";
            xParser.parseStrict(aParseURL);
            URL aURL = aParseURL[0];
            XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
            if(xDispatcher != null)
                xDispatcher.dispatch( aURL, null );
        } catch (com.sun.star.uno.Exception e) {
            failed("Couldn't change mode");
            return;
        }

        try {
            Thread.currentThread().sleep(500) ;
        } catch (InterruptedException e) {
            System.out.println("While waiting :" + e) ;
        }



        log.println("Press any key when a shape is on top.");
        try{
            byte[]b = new byte[16];
            System.in.read(b);
        } catch (Exception e) {
            e.printStackTrace();
        }

        // get the accessible content
        AccessibilityTools at = new AccessibilityTools();

        XWindow xWindow = at.getCurrentWindow(mXMSF, aModel);
        XAccessible xRoot = at.getAccessibleObject(xWindow);
        XAccessible parent = null;

        try {
            XAccessibleContext con = at.getAccessibleObjectForRole
                                (xRoot, AccessibleRole.SHAPE, "");
            log.println("Name of AccessibleContext: " + con.getAccessibleName());
            oObj = con;
        } catch (Exception e) {
            failed(e.getMessage());
            return;
        }

        log.println("ImplementationName: " + utils.getImplName(oObj));
        util.dbg.printInterfaces(oObj);

        xComp.dispose();
    }
View Full Code Here

Examples of com.sun.star.lang.XComponent

                                              XDrawPage.class,
                                              oDP.getByIndex(0));

            SOfficeFactory SOF = SOfficeFactory.getFactory(
                                         (XMultiServiceFactory) param.getMSF());
            XComponent xComp = (XComponent) UnoRuntime.queryInterface(
                                       XComponent.class, xSheetDoc);
            insertedShape = SOF.createShape(xComp, 5000, 3500, 700, 500,
                                            "Rectangle");
            DrawTools.getShapes(firstDrawPage).add(insertedShape);
        } catch (com.sun.star.lang.WrappedTargetException e) {
View Full Code Here

Examples of com.sun.star.lang.XComponent

     * Be aware, the ownership of the document gets to you, you have to close it.
     */
    public static XComponent loadFromURL(GraphicalTestArguments _aGTA,
                                         String _sInputURL)
        {
            XComponent aDoc = null;
            try
            {
                if (_aGTA.getMultiServiceFactory() == null)
                {
                    GlobalLogWriter.get().println("MultiServiceFactory in GraphicalTestArgument not set.");
View Full Code Here

Examples of com.sun.star.lang.XComponent

    public static boolean storeAsPDF(GraphicalTestArguments _aGTA,
                                     String _sInputURL,
                                     String _sOutputURL)
        {
            boolean bBack = false;
            XComponent aDoc = loadFromURL(_aGTA, _sInputURL);
               
            if (aDoc == null)
            {
                GlobalLogWriter.get().println("Can't load document.");
                return bBack;
            }
            bBack = storeAsPDF(_aGTA, aDoc, _sOutputURL);
            createInfoFile(_sOutputURL, _aGTA, "as pdf");

            GlobalLogWriter.get().println("Close document.");
            aDoc.dispose();
            return bBack;
        }
View Full Code Here

Examples of com.sun.star.lang.XComponent

                                             String _sPrintFileURL)
        {
            // waitInSeconds(1);
            boolean bBack = false;
           
            XComponent aDoc = loadFromURL(_aGTA, _sInputURL);
            if (aDoc != null)
            {
                if ( _sInputURL.equals(_sOutputURL) )
                {
                    // don't store document
                    // input and output are equal OR
                    GlobalLogWriter.get().println("Warning: Inputpath and Outputpath are equal. Document will not stored again.");
                    _aGTA.disallowStore();
                }
                bBack = impl_printToFileWithOOo(_aGTA, aDoc, _sOutputURL, _sPrintFileURL);
               
                GlobalLogWriter.get().println("Close document.");
                aDoc.dispose();
            }
            else
            {
                GlobalLogWriter.get().println("loadDocumentFromURL() failed with document: " + _sInputURL);
            }
View Full Code Here

Examples of com.sun.star.lang.XComponent

                            _aGTA.getPerformance().stopTime(PerformanceContainer.Store);

                            GlobalLogWriter.get().println(DateHelper.getDateTimeForHumanreadableLog() + " Store document done.");
                            TimeHelper.waitInSeconds(2, "After store as URL to:" + _sOutputURL);
                            GlobalLogWriter.get().println("Reload stored file test.");
                            XComponent aDoc = loadFromURL(_aGTA, _sOutputURL);
                            if (aDoc == null)
                            {
                                GlobalLogWriter.get().println("Reload stored file test failed, can't reload file: " + _sOutputURL);
                            }
                        }
View Full Code Here

Examples of com.sun.star.lang.XComponent

                return;
            }
           
            String sInputURL = URLHelper.getFileURLFromSystemPath(_sInputFile);
            // showType(sInputURL, xMSF);
            XComponent aDoc = loadFromURL( _aGTA, sInputURL);
            if (aDoc == null)
            {
                GlobalLogWriter.get().println("Can't load document '"+ sInputURL + "'");
                return;
            }
View Full Code Here

Examples of com.sun.star.lang.XComponent

   */

    public XTextDocument createTextDoc( String frameName )
                                        throws com.sun.star.uno.Exception {

        XComponent oDoc = openDoc("swriter",frameName);

        if ( oDoc != null) {
            return (XTextDocument)
                UnoRuntime.queryInterface( XTextDocument.class, oDoc );
        }
View Full Code Here

Examples of com.sun.star.lang.XComponent

   */

    public XTextDocument createTextDoc( String frameName, PropertyValue[] mediaDescriptor )
                                        throws com.sun.star.uno.Exception {

        XComponent oDoc = openDoc("swriter", frameName, mediaDescriptor);

        if ( oDoc != null) {
            return (XTextDocument) UnoRuntime.queryInterface( XTextDocument.class, oDoc );
        }
        else {
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.