Package util

Examples of util.SOfficeFactory.createInstance()


        // INSTANCEn : _XNameContainer; _XNameReplace
        log.println( "adding INSTANCEn as mod relation to environment" );
        for (int n = 1; n < 2*(THRCNT+1) ;n++ ) {
            log.println( "adding INSTANCE" + n +
                                            " as mod relation to environment" );
            tEnv.addObjRelation("INSTANCE" + n, SOF.createInstance(
                                    xComp,"com.sun.star.style.CellStyle"));
        }
        // NAMEREPLACE : _XNameReplace
        log.println("adding NAMEREPLACE as mod relation to environment");
        String cName = "ScStyleFamilyObj";
View Full Code Here


            //obtain style family with name[0]
            Object objectStyle = StyleFamilies.getByName(styleFamilyName);
            XNameContainer xStyleFamilyName = (XNameContainer)
                UnoRuntime.queryInterface(XNameContainer.class, objectStyle);
            //creat new style
            Object SC = SOF.createInstance(xDrawDoc, "com.sun.star.style.Style");
            XStyle Style = (XStyle) UnoRuntime.queryInterface(XStyle.class,SC);
            //add new style to style familiy with name[0]
            xStyleFamilyName.insertByName(STYLE_NAME,Style);
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
View Full Code Here

        XComponent oComp = (XComponent)
                    UnoRuntime.queryInterface (XComponent.class, xSheetDoc);

        oObj = (XInterface)
            SOF.createInstance(oComp, "com.sun.star.sheet.SheetCellRanges");

        XSpreadsheets oSheets = xSheetDoc.getSheets() ;
        XIndexAccess oIndSheets = (XIndexAccess)
            UnoRuntime.queryInterface (XIndexAccess.class, oSheets);
        XSpreadsheet oSheet = null;
View Full Code Here

            XNameAccess styleFamilies = styleSup.getStyleFamilies();
            String[] styleFamiliesNames = styleFamilies.getElementNames();
            XNameContainer StyleFamilyName = (XNameContainer)
                UnoRuntime.queryInterface(XNameContainer.class,
                styleFamilies.getByName(styleFamiliesNames[0]));
            Object SC = SOF.createInstance
                (xImpressDoc, "com.sun.star.style.Style");
            XStyle StylePage = (XStyle)
                UnoRuntime.queryInterface(XStyle.class,SC);
            StyleFamilyName.insertByName(newName, StylePage);
View Full Code Here

        XInterface oObj = null;
        Object oGObject = null;
        SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );

        try {
            oGObject = SOF.createInstance
                (xTextDoc,"com.sun.star.text.GraphicObject");
        }
        catch (Exception ex) {
            log.println("Couldn't create instance");
            ex.printStackTrace(log);
View Full Code Here

            XText oFrameText = oFrame1.getText();
            oFrameText.insertString(oFrameText.getStart(), "The FrameText",
                                    true);

            instance = SOF.createInstance(xTextDoc,
                                          "com.sun.star.text.TextFrame");
        } catch (Exception Ex) {
            Ex.printStackTrace(log);
            throw new StatusException("Couldn't insert TextFrame ", Ex);
        }
View Full Code Here

        Object instance = null;
        log.println( "creating a test environment" );
        try {
            oObj = SOF.createBookmark( xTextDoc );
            SOF.insertTextContent( xTextDoc, (XTextContent) oObj );
            instance = SOF.createInstance(xTextDoc,"com.sun.star.text.Bookmark");
        } catch ( com.sun.star.uno.Exception e ) {
            e.printStackTrace( log );
            throw new StatusException( "Couldn't create Bookmark", e );
        }
        log.println( "creating a new environment for bodytext object" );
View Full Code Here

            XNameAccess styleFamilies = styleSup.getStyleFamilies();
            String[] styleFamiliesNames = styleFamilies.getElementNames();
            XNameContainer StyleFamilyName = (XNameContainer)
                UnoRuntime.queryInterface(XNameContainer.class,
                styleFamilies.getByName(styleFamiliesNames[0]));
            Object SC = SOF.createInstance
                (xImpressDoc, "com.sun.star.style.Style");
            XStyle StylePage = (XStyle)
                UnoRuntime.queryInterface(XStyle.class,SC);
            StyleFamilyName.insertByName(newName, StylePage);
View Full Code Here

        SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
        XComponent xComp = (XComponent)
            UnoRuntime.queryInterface(XComponent.class, xTextDoc);
        XInterface oInstance = (XInterface)
            SOF.createInstance(xComp, "com.sun.star.style.CharacterStyle");
        XStyleFamiliesSupplier oSFsS = (XStyleFamiliesSupplier)
                UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc);
        XNameAccess oSF = oSFsS.getStyleFamilies();
        XIndexAccess oSFIA = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, oSF);
View Full Code Here

        tEnv.addObjRelation("XNameReplaceINDEX", nr);

        for (int n=1; n<(THRCNT+3); n++ ) {
            log.println( "adding INSTANCE"+n+" as mod relation to environment");
            tEnv.addObjRelation("INSTANCE"+n,
                SOF.createInstance(xComp,"com.sun.star.style.CharacterStyle"));
        }

        log.println("adding NAMEREPLACE as mod relation to environment");
        tEnv.addObjRelation("NAMEREPLACE", "SwXStyleFamily");
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.