Package com.sun.star.util

Examples of com.sun.star.util.XModifiable


        XDrawPage new_page = the_pages.insertNewByIndex(1);
        tEnv.addObjRelation("DrawPage", new_page);

        log.println("Implementation Name: "+utils.getImplName(oObj));

        XModifiable modify = (XModifiable)
            UnoRuntime.queryInterface(XModifiable.class,xDrawDoc);

        tEnv.addObjRelation("Modifiable",modify);
       
        tEnv.addObjRelation("XComponent.DisposeThis", xDrawDoc);
View Full Code Here


        try
        {
            if ( m_documentDefinition != null )
            {
                // set the document to "not modified", to ensure that it won't ask the user before closing
                XModifiable documentModify = UnoRuntime.queryInterface( XModifiable.class, m_reportDocument );
                documentModify.setModified( false );
                // actually close
                XSubDocument subComponent = UnoRuntime.queryInterface( XSubDocument.class, m_documentDefinition );
                subComponent.close();
            }
        }
View Full Code Here

    {
        try
        {
            if (xComponent != null)
            {
                XModifiable xModified = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, xComponent);
                XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent);
                XFrame xFrame = xModel.getCurrentController().getFrame();
                if (xModified.isModified())
                {
                    xModified.setModified(false);
                }
                Desktop.dispatchURL(xMSF, ".uno:CloseDoc", xFrame);
            }
        }
        catch (PropertyVetoException exception)
View Full Code Here

        finally
        {
            if ( subComponentCommands != null )
            {
                XComponentSupplier componentSupplier = UnoRuntime.queryInterface( XComponentSupplier.class, subComponentCommands );
                XModifiable modifySubComponent = UnoRuntime.queryInterface( XModifiable.class, componentSupplier.getComponent() );
                modifySubComponent.setModified( false );
                Command command = new Command();
                command.Name = "close";
                subComponentCommands.execute( command, subComponentCommands.createCommandIdentifier(), null );
            }
View Full Code Here

        try
        {
            if ( m_document != null )
            {
                // first, set the document to "unmodified"
                XModifiable docModify = (XModifiable)m_document.query( XModifiable.class );
                docModify.setModified( false );

                m_document.getCurrentView().dispatch( ".uno:CloseDoc" );

                // CloseDoc is asynchronous, so wait until it's done - or 1 second, at most
                synchronized ( this ) { wait( 1000 ); }
View Full Code Here

    }

    /* ------------------------------------------------------------------ */
    public boolean isModified()
    {
        XModifiable modify = (XModifiable)query( XModifiable.class );
        return modify.isModified();
    }
View Full Code Here

// from the backing window it is returned to the backing window, so the
// office won't be closed
    public static void disposeDocument(XMultiServiceFactory xMSF, com.sun.star.lang.XComponent xComponent){
    try{
  if (xComponent != null){
      XModifiable xModified = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, xComponent);
      XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent);
      XFrame xFrame = xModel.getCurrentController().getFrame();
      if (xModified.isModified())
    xModified.setModified(false);
      dispatchURL(xMSF, ".uno:CloseDoc", xFrame);
  }
    }
    catch( com.sun.star.beans.PropertyVetoException exception ){
        exception.printStackTrace(System.out);
View Full Code Here

                {
                    "OnSaveAs", "OnSaveAsDone"
                }, context);

        // XModifiable.setModified
        final XModifiable modifyDoc = (XModifiable) UnoRuntime.queryInterface(XModifiable.class,
                databaseDoc);
        context = "setModified";
        impl_startObservingEvents(context);
        modifyDoc.setModified(true);
        assureEquals("setModified didn't work", modifyDoc.isModified(), true);
        impl_stopObservingEvents(m_globalEvents, new String[]
                {
                    "OnModifyChanged"
                }, context);

        // XStorable.store, with implicit reset of the "Modified" flag
        context = "store (2)";
        impl_startObservingEvents(context);
        storeDoc.store();
        assureEquals("'store' should implicitly reset the modified flag", modifyDoc.isModified(), false);
        impl_stopObservingEvents(m_globalEvents, new String[]
                {
                    "OnSave", "OnSaveDone", "OnModifyChanged"
                }, context);
View Full Code Here

TOP

Related Classes of com.sun.star.util.XModifiable

Copyright © 2018 www.massapicom. 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.