Examples of XNameContainer


Examples of com.sun.star.container.XNameContainer

        if (oMyStyle == null)
            log.println("FAILED");
        else
            log.println("OK");
            XNameContainer oSFNC = (XNameContainer)
            UnoRuntime.queryInterface(XNameContainer.class, oSFNA);

        try {
            if ( oSFNC.hasByName("My Style") )
                oSFNC.removeByName("My Style");
            oSFNC.insertByName("My Style", oMyStyle);
        } catch ( com.sun.star.lang.WrappedTargetException e ) {
            e.printStackTrace(log);
            throw new StatusException( "Couldn't create environment ", e );
        } catch     ( com.sun.star.lang.IllegalArgumentException e ) {
            e.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.container.XNameContainer

                if (oDrawPage == null)
                    log.println("ERROR: could not get DrawPage: null");
               
                oDrawPage.add(aShape);
                log.println("getting XForm");
                XNameContainer xForm = FormTools.getForms(oDrawPage);
                try {
                    myForm = (XForm) AnyConverter.toObject(new Type(XForm.class),xForm.getByName("Standard"));
                } catch (WrappedTargetException ex) {
                    log.println("ERROR: could not XFormm 'Standard': " + ex.toString());
                } catch (com.sun.star.lang.IllegalArgumentException ex) {
                    log.println("ERROR: could not XFormm 'Standard': " + ex.toString());
                } catch (NoSuchElementException ex) {
View Full Code Here

Examples of com.sun.star.container.XNameContainer

        XInterface ctrl = SOF.createControl(xDrawDoc, objName);
       
        try {
            XDrawPage oDP = DrawTools.getDrawPage(xDrawDoc, 0);
           
            XNameContainer nc = FormTools.getForms(oDP);
            FormTools.insertForm(xDrawDoc, nc, "OHiddenModelForm");
           
            Object frm = nc.getByName("OHiddenModelForm");
           
            XNameContainer frmNC = (XNameContainer) UnoRuntime.queryInterface(
                    XNameContainer.class, frm);
           
            frmNC.insertByName("OHiddenModel", ctrl);
            oObj = (XInterface) AnyConverter.toObject(
                    new Type(XInterface.class),
                    frmNC.getByName("OHiddenModel"));
        } catch (com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace(log);
            throw new StatusException("Can't create and add control", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.container.XNameContainer

        try
        {
            XPropertySet docProps = dbfTools.queryPropertySet( m_document.getDocument() );
            XLibraryContainer basicLibs = (XLibraryContainer)UnoRuntime.queryInterface(
                XLibraryContainer.class, docProps.getPropertyValue( "BasicLibraries" ) );
            XNameContainer basicLib = basicLibs.createLibrary( "default" );

            String sListSelectionScript =
                "Option Explicit\n" +
                "\n" +
                "Sub onListBoxSelected( oEvent as Object )\n" +
                "    Dim oView as Object\n" +
                "    Dim oSheet as Object\n" +
                "    Dim oSheets as Object\n" +
                "\n" +
                "    Dim oControlModel as Object\n" +
                "    Dim sSheet as String\n" +
                "\n" +
                "    if ( oEvent.Selected <> 65535 ) Then\n" +
                "        oControlModel = oEvent.Source.Model\n" +
                "        sSheet = oControlModel.StringItemList( oEvent.Selected )\n" +
                "\n" +
                "        oSheets = thisComponent.Sheets\n" +
                "        oSheet = oSheets.getByName(sSheet)\n" +
                "\n" +
                "       oView = thisComponent.CurrentController\n" +
                "       oView.setActiveSheet( oSheet )\n" +
                "    End If\n" +
                "End Sub\n" +
                "\n" +
                "Sub onButtonClicked\n" +
                "    MsgBox \"clicked\"\n" +
                "End Sub\n";

            basicLib.insertByName( "callbacks", sListSelectionScript );
        }
        catch( com.sun.star.uno.Exception e )
        {
            e.printStackTrace( System.err );
        }
View Full Code Here

Examples of com.sun.star.container.XNameContainer

            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }

        XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
                                            XNameContainer.class, oObj);

        try {
            aContainer.insertByName("First", aControl);
            aContainer.insertByName("Second", aControl2);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
View Full Code Here

Examples of com.sun.star.container.XNameContainer

            com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command();
            aCommand.Name = "storeOwn";

            final Object aObj2 = xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null);
           
            final XNameContainer aNameContainer = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, m_aReportDocument);
//             aNameContainer.insertByName(Name, m_xReportDefinition);
            aNameContainer.insertByName(Name, m_aDocumentDefinition);
        }
        catch (Exception e)
        {
            int dummy = 0;
        }
View Full Code Here

Examples of com.sun.star.container.XNameContainer

            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }

        XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
                                            XNameContainer.class, oObj);

        try {
            aContainer.insertByName("First", aControl);
            aContainer.insertByName("Second", aControl2);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
View Full Code Here

Examples of com.sun.star.container.XNameContainer

        log.println( "get custom presentation" );
        XCustomPresentationSupplier oCPS = (XCustomPresentationSupplier)
            UnoRuntime.queryInterface(
                XCustomPresentationSupplier.class, xImpressDoc);
        XNameContainer xCP = oCPS.getCustomPresentations();

        XInterface oInstance = null;

        XSingleServiceFactory oSingleMSF = (XSingleServiceFactory)
            UnoRuntime.queryInterface(XSingleServiceFactory.class, xCP);

        try{
            oInstance = (XInterface) oSingleMSF.createInstance();
        } catch (com.sun.star.uno.Exception e) {
            log.println("Could not create custom presentation while filling impress document with content.");
            failed("Couldn't create test environment");
        }

        try {
            xCP.insertByName("FirstPresentation",oInstance);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            log.println("Could not instert custom presentation while filling impress document with content.");
            failed("Couldn't create test environment");
        } catch (com.sun.star.container.ElementExistException e) {
            log.println("Could not instert custom presentation while filling impress document with content.");
View Full Code Here

Examples of com.sun.star.container.XNameContainer

            UnoRuntime.queryInterface (XIndexAccess.class, oSheets);
        XSpreadsheet oSheet = null;
        try {
            oSheet = (XSpreadsheet) AnyConverter.toObject(
                    new Type(XSpreadsheet.class), oIndSheets.getByIndex(0));
            XNameContainer oRanges = (XNameContainer)
                UnoRuntime.queryInterface(XNameContainer.class, oObj);

            oRange = oSheet.getCellRangeByName("C1:D4");
            oRanges.insertByName("Range1", oRange);
            oRange = oSheet.getCellRangeByName("E2:F5");
            oRanges.insertByName("Range2", oRange);
            oRange = oSheet.getCellRangeByName("G2:H3");
            oRanges.insertByName("Range3", oRange);
            oRange = oSheet.getCellRangeByName("I7:J8");
            oRanges.insertByName("Range4", oRange);
        } catch(com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't create test object", e);
        } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            e.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.container.XNameContainer

           
            XDrawPage xDP = WriterTools.getDrawPage(xTextDoc);
            if (xDP == null)
                log.println("ERROR: could not get DrawPage");
           
            XNameContainer xForms = FormTools.getForms(xDP);
            if (xForms == null)
                log.println("ERROR: could not get Forms");
           
                log.println("the draw page contains folowing elemtens:");
                String[] elements = FormTools.getForms(WriterTools.getDrawPage(xTextDoc)).getElementNames();
                for (int i = 0; i< elements.length; i++){
                    log.println("Element[" + i + "] :" + elements[i]);
                }
               
            myForm = (XForm) AnyConverter.toObject(new Type(XForm.class), xForms.getByName("Standard"));
                if (myForm == null){
                    log.println("ERROR: could not get 'Standard' from drawpage!");
            if (debug){
                log.println("the draw page contains folowing elemtens:");
//                String[] elements = FormTools.getForms(WriterTools.getDrawPage(xTextDoc)).getElementNames();
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.