Examples of XLoadable


Examples of com.sun.star.frame.XLoadable

        // ....................................................................
        // 2. XLoadable::load
        databaseDoc = UnoRuntime.queryInterface(XModel.class, getMSF().createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
        documentURL = copyToTempFile(documentURL);
        // load the doc, and verify it's initialized then, and has the proper URL
        XLoadable loadDoc = UnoRuntime.queryInterface(XLoadable.class, databaseDoc);
        loadDoc.load(new PropertyValue[]
                {
                    new PropertyValue("URL", 0, documentURL, PropertyState.DIRECT_VALUE)
                });
        databaseDoc.attachResource(documentURL, new PropertyValue[0]);

        assertEquals("wrong URL after loading the document", documentURL, databaseDoc.getURL());
        impl_checkDocumentInitState(databaseDoc, true);

        // and while we are here ... initilizing the same document again should not be possible
        assureException( databaseDoc, XLoadable.class, "initNew", new Object[0],
            DoubleInitializationException.class );
        assureException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] },
            DoubleInitializationException.class );

        // ....................................................................
        // 3. XLoadable::initNew
        impl_closeDocument(databaseDoc);
        databaseDoc = impl_createDocument();
        loadDoc = UnoRuntime.queryInterface(XLoadable.class, databaseDoc);
        loadDoc.initNew();
        assertEquals("wrong URL after initializing the document", "", databaseDoc.getURL());
        impl_checkDocumentInitState(databaseDoc, true);

        // same as above - initializing the document a second time must fail
        assureException( databaseDoc, XLoadable.class, "initNew", new Object[0],
View Full Code Here

Examples of com.sun.star.frame.XLoadable

                    "OnPrepareViewClosing", "OnViewClosed", "OnPrepareUnload", "OnUnload"
                }, context);

        // creating a new document
        databaseDoc = impl_createDocument();
        final XLoadable loadDoc = UnoRuntime.queryInterface(XLoadable.class, databaseDoc);
        context = "initNew";
        impl_startObservingEvents(context);
        loadDoc.initNew();
        impl_stopObservingEvents(m_globalEvents, new String[]
                {
                    "OnCreate"
                }, context);
View Full Code Here

Examples of com.sun.star.frame.XLoadable

                Object oTempFile = m_xMSF.createInstance ( "com.sun.star.io.TempFile" );
                XTempFile xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile);
               
                //create a text document and initiallize it
                Object oTextDocument = m_xMSF.createInstance ( "com.sun.star.text.TextDocument" );
                XLoadable xLoadable = UnoRuntime.queryInterface(XLoadable.class, oTextDocument);
                xLoadable.initNew();
                m_aTestHelper.Message ( "New document initialized." );
               
                //store the instance to the temporary file URL
                XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, oTextDocument);
                String sURL = AnyConverter.toString ( xTempFile.getUri () );
View Full Code Here

Examples of com.sun.star.frame.XLoadable

                XTempFile xTempFile = (XTempFile) UnoRuntime.queryInterface (
                    XTempFile.class, oTempFile );
               
                //create a text document and initiallize it
                Object oTextDocument = m_xMSF.createInstance ( "com.sun.star.text.TextDocument" );
                XLoadable xLoadable = (XLoadable) UnoRuntime.queryInterface (
                        XLoadable.class, oTextDocument );
                xLoadable.initNew();
                m_aTestHelper.Message ( "New document initialized." );
               
                //store the instance to the temporary file URL
                XStorable xStorable = (XStorable) UnoRuntime.queryInterface (
                        XStorable.class, oTextDocument );
View Full Code Here

Examples of com.sun.star.frame.XLoadable

        {
            // create the empty document, and set its module identifier
            xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,
                    xMSF.createInstance("com.sun.star.text.TextDocument"));

            XLoadable xLoadable = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, xTextDocument);
            xLoadable.initNew();

            XModule xModule = (XModule) UnoRuntime.queryInterface(XModule.class,
                    xTextDocument);
            xModule.setIdentifier(_moduleIdentifier.getIdentifier());
View Full Code Here

Examples of com.sun.star.frame.XLoadable

        // 2. XLoadable::load
        databaseDoc = (XModel) UnoRuntime.queryInterface(XModel.class,
                getORB().createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
        documentURL = copyToTempFile(documentURL);
        // load the doc, and verify it's initialized then, and has the proper URL
        XLoadable loadDoc = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, databaseDoc);
        loadDoc.load(new PropertyValue[]
                {
                    new PropertyValue("URL", 0, documentURL, PropertyState.DIRECT_VALUE)
                });
        databaseDoc.attachResource(documentURL, new PropertyValue[0]);

        assureEquals("wrong URL after loading the document", documentURL, databaseDoc.getURL());
        impl_checkDocumentInitState(databaseDoc, true);

        // and while we are here ... initilizing the same document again should not be possible
        assureException( databaseDoc, XLoadable.class, "initNew", new Object[0],
            DoubleInitializationException.class );
        assureException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] },
            DoubleInitializationException.class );

        // ....................................................................
        // 3. XLoadable::initNew
        impl_closeDocument(databaseDoc);
        databaseDoc = impl_createDocument();
        loadDoc = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, databaseDoc);
        loadDoc.initNew();
        assureEquals("wrong URL after initializing the document", "", databaseDoc.getURL());
        impl_checkDocumentInitState(databaseDoc, true);

        // same as above - initializing the document a second time must fail
        assureException( databaseDoc, XLoadable.class, "initNew", new Object[0],
View Full Code Here

Examples of com.sun.star.frame.XLoadable

                    "OnPrepareViewClosing", "OnViewClosed", "OnPrepareUnload", "OnUnload"
                }, context);

        // creating a new document
        databaseDoc = impl_createDocument();
        final XLoadable loadDoc = (XLoadable) UnoRuntime.queryInterface(XLoadable.class,
                databaseDoc);
        context = "initNew";
        impl_startObservingEvents(context);
        loadDoc.initNew();
        impl_stopObservingEvents(m_globalEvents, new String[]
                {
                    "OnCreate"
                }, context);
View Full Code Here

Examples of com.sun.star.frame.XLoadable

        // 2. XLoadable::load
        databaseDoc = (XModel)UnoRuntime.queryInterface( XModel.class,
            getORB().createInstance( "com.sun.star.sdb.OfficeDatabaseDocument" ) );
        documentURL = impl_copyTempFile( documentURL );
        // load the doc, and verify it's initialized then, and has the proper URL
        XLoadable loadDoc = (XLoadable)UnoRuntime.queryInterface( XLoadable.class, databaseDoc );
        loadDoc.load( new PropertyValue[] { new PropertyValue( "URL", 0, documentURL, PropertyState.DIRECT_VALUE ) } );
        databaseDoc.attachResource( documentURL, new PropertyValue[0] );

        assureEquals( "wrong URL after loading the document", documentURL, databaseDoc.getURL() );
        impl_checkDocumentInitState( databaseDoc, true );

        // and while we are here ... initilizing the same document again should not be possible
        verifyExpectedException( databaseDoc, XLoadable.class, "initNew", new Object[0],
            DoubleInitializationException.class );
        verifyExpectedException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] },
            DoubleInitializationException.class );

        // ....................................................................
        // 3. XLoadable::initNew
        impl_closeDocument( databaseDoc );
        databaseDoc = impl_createDocument();
        loadDoc = (XLoadable)UnoRuntime.queryInterface( XLoadable.class, databaseDoc );
        loadDoc.initNew();
        assureEquals( "wrong URL after initializing the document", "", databaseDoc.getURL() );
        impl_checkDocumentInitState( databaseDoc, true );

        // same as above - initializing the document a second time must fail
        verifyExpectedException( databaseDoc, XLoadable.class, "initNew", new Object[0],
View Full Code Here

Examples of com.sun.star.frame.XLoadable

        impl_stopObservingEvents( m_globalEvents,
            new String[] { "OnPrepareViewClosing", "OnViewClosed", "OnPrepareUnload", "OnUnload" }, context );

        // creating a new document
        databaseDoc = impl_createDocument();
        XLoadable loadDoc = (XLoadable) UnoRuntime.queryInterface( XLoadable.class,
            databaseDoc );
        context = "initNew";
        impl_startObservingEvents( context );
        loadDoc.initNew();
        impl_stopObservingEvents( m_globalEvents, new String[] { "OnCreate" }, context );

        impl_startObservingEvents( context + " (cleanup)" );
        impl_closeDocument( databaseDoc );
        impl_waitForEvent( m_globalEvents, "OnUnload", 5000 );
View Full Code Here

Examples of com.sun.star.frame.XLoadable

        {
            // create the empty document, and set its module identifier
            xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,
                    xMSF.createInstance("com.sun.star.text.TextDocument"));

            XLoadable xLoadable = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, xTextDocument);
            xLoadable.initNew();

            XModule xModule = (XModule) UnoRuntime.queryInterface(XModule.class,
                    xTextDocument);
            xModule.setIdentifier(_moduleIdentifier.getIdentifier());
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.