Examples of XFormController


Examples of com.sun.star.form.XFormController

       
        log.println("enable DesignMode");
        oObj.setFormDesignMode(false);
       
        log.println("test for getFromController() ");
        XFormController xFormCont = oObj.getFormController(xForm);
       
        if (xFormCont == null)
            log.println("ERROR: Could not get FromContoller");
       
        log.println("set back DesignMode to previouse state");
View Full Code Here

Examples of com.sun.star.form.XFormController

            doc.getCurrentController() );
        docUI.connect();

        // display the table
        XComponent tableViewComp = docUI.loadComponent( com.sun.star.sdb.application.DatabaseObject.TABLE, "customers", false );
        XFormController tableViewController = (XFormController)UnoRuntime.queryInterface( XFormController.class,
            tableViewComp );
        XPropertySet tableControlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
            tableViewController.getCurrentControl().getModel() );

        // change the table's formatting
        tableControlModel.setPropertyValue( "FontName", "Andale Sans UI" );
        tableControlModel.setPropertyValue( "FontHeight", Float.valueOf( 20 ) );
        tableControlModel.setPropertyValue( "FontSlant", FontSlant.ITALIC );

        // close the table
        docUI.closeSubComponents();

        // save and close the database document
        database.getDatabase().store();
        database.close();

        // load a copy of the document
        // normally, it should be sufficient to load the same doc. However, there might be objects in the Java VM
        // which are not yet freed, and which effectively hold the document alive. More precise: The document (|doc|)
        // is certainly disposed, but other objects might hold a reference to one of the many other components
        // around the database document, the data source, the connection, etc. As long as those objects are
        // not cleaned up, the "database model impl" - the structure holding all document data - will
        // stay alive, and subsequent requests to load the doc will just reuse it, without really loading it.
        docURL = copyToTempFile( docURL );
        doc = (XModel)UnoRuntime.queryInterface( XModel.class,
            loader.loadComponentFromURL( docURL, "_blank", 0, new PropertyValue[] {} ) );

        docUI = (XDatabaseDocumentUI)UnoRuntime.queryInterface( XDatabaseDocumentUI.class,
            doc.getCurrentController() );
        docUI.connect();

        // display the table, again
        tableViewComp = docUI.loadComponent( com.sun.star.sdb.application.DatabaseObject.TABLE, "customers", false );
        tableViewController = (XFormController)UnoRuntime.queryInterface( XFormController.class,
            tableViewComp );
        tableControlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
            tableViewController.getCurrentControl().getModel() );

        // verify the properties
        assureEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) );
        assureEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue() );
        assureEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) );
View Full Code Here

Examples of com.sun.star.form.XFormController

       
        log.println("enable DesignMode");
        oObj.setFormDesignMode(false);
       
        log.println("test for getFromController() ");
        XFormController xFormCont = oObj.getFormController(xForm);
       
        if (xFormCont == null)
            log.println("ERROR: Could not get FromContoller");
       
        log.println("set back DesignMode to previouse state");
View Full Code Here

Examples of com.sun.star.form.XFormController

            doc.getCurrentController() );
        docUI.connect();

        // display the table
        XComponent tableViewComp = docUI.loadComponent( com.sun.star.sdb.application.DatabaseObject.TABLE, "customers", false );
        XFormController tableViewController = (XFormController)UnoRuntime.queryInterface( XFormController.class,
            tableViewComp );
        XPropertySet tableControlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
            tableViewController.getCurrentControl().getModel() );

        // change the table's formatting
        tableControlModel.setPropertyValue( "FontName", "Andale Sans UI" );
        tableControlModel.setPropertyValue( "FontHeight", Float.valueOf( 20 ) );
        tableControlModel.setPropertyValue( "FontSlant", FontSlant.ITALIC );

        // close the table
        docUI.closeSubComponents();

        // save and close the database document
        database.getDatabase().store();
        database.close();

        // load a copy of the document
        // normally, it should be sufficient to load the same doc. However, there might be objects in the Java VM
        // which are not yet freed, and which effectively hold the document alive. More precise: The document (|doc|)
        // is certainly disposed, but other objects might hold a reference to one of the many other components
        // around the database document, the data source, the connection, etc. As long as those objects are
        // not cleaned up, the "database model impl" - the structure holding all document data - will
        // stay alive, and subsequent requests to load the doc will just reuse it, without really loading it.
        docURL = copyToTempFile( docURL );
        doc = (XModel)UnoRuntime.queryInterface( XModel.class,
            loader.loadComponentFromURL( docURL, "_blank", 0, new PropertyValue[] {} ) );

        docUI = (XDatabaseDocumentUI)UnoRuntime.queryInterface( XDatabaseDocumentUI.class,
            doc.getCurrentController() );
        docUI.connect();

        // display the table, again
        tableViewComp = docUI.loadComponent( com.sun.star.sdb.application.DatabaseObject.TABLE, "customers", false );
        tableViewController = (XFormController)UnoRuntime.queryInterface( XFormController.class,
            tableViewComp );
        tableControlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
            tableViewController.getCurrentControl().getModel() );

        // verify the properties
        assureEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) );
        assureEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue() );
        assureEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) );
View Full Code Here

Examples of com.sun.star.form.XFormController

       
        log.println("enable DesignMode");
        oObj.setFormDesignMode(false);
       
        log.println("test for getFromController() ");
        XFormController xFormCont = oObj.getFormController(xForm);
       
        if (xFormCont == null)
            log.println("ERROR: Could not get FromContoller");
       
        log.println("set back DesignMode to previouse state");
View Full Code Here

Examples of com.sun.star.form.runtime.XFormController

    {
        // create, load, and connect a DB doc
        CRMDatabase database = new CRMDatabase( getMSF(), true );

        // display a table
        XFormController tableViewController = UnoRuntime.queryInterface( XFormController.class,
            database.loadSubComponent( DatabaseObject.TABLE, "customers" ) );
        XPropertySet tableControlModel = UnoRuntime.queryInterface( XPropertySet.class,
            tableViewController.getCurrentControl().getModel() );

        // change the table's formatting
        tableControlModel.setPropertyValue( "FontName", "Andale Sans UI" );
        tableControlModel.setPropertyValue( "FontHeight", Float.valueOf( 20 ) );
        tableControlModel.setPropertyValue( "FontSlant", FontSlant.ITALIC );

        String docURL = database.getDatabase().getModel().getURL();

        // save close the database document
        database.saveAndClose();

        // load a copy of the document
        // normally, it should be sufficient to load the same doc. However, there might be objects in the Java VM
        // which are not yet freed, and which effectively hold the document alive. More precise: The document (|doc|)
        // is certainly disposed, but other objects might hold a reference to one of the many other components
        // around the database document, the data source, the connection, etc. As long as those objects are
        // not cleaned up, the "database model impl" - the structure holding all document data - will
        // stay alive, and subsequent requests to load the doc will just reuse it, without really loading it.
        docURL = copyToTempFile( docURL );
        loadDocument( docURL );
        database = new CRMDatabase( getMSF(), docURL );

        // display the table, again
        tableViewController = UnoRuntime.queryInterface( XFormController.class,
            database.loadSubComponent( DatabaseObject.TABLE, "customers" ) );
        tableControlModel = UnoRuntime.queryInterface( XPropertySet.class,
            tableViewController.getCurrentControl().getModel() );

        // verify the properties
        assertEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) );
        assertEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue(), 0 );
        assertEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) );
View Full Code Here

Examples of com.sun.star.form.runtime.XFormController

        // create, load, and connect a DB doc
        CRMDatabase database = new CRMDatabase( getMSF(), true );

        // display a table
        XController tableView = database.loadSubComponent( DatabaseObject.TABLE, "customers" );
        XFormController tableViewController = UnoRuntime.queryInterface( XFormController.class,
             tableView );
        XNameAccess tableControlModel = UnoRuntime.queryInterface( XNameAccess.class,
            tableViewController.getCurrentControl().getModel() );

        // change the formatting of a table column
        XPropertySet idColumn = UnoRuntime.queryInterface( XPropertySet.class, tableControlModel.getByName( "ID" ) );
        assertTrue( "precondition not met: column already centered",
            ((Short)idColumn.getPropertyValue( "Align" )).shortValue() != TextAlign.CENTER );
        idColumn.setPropertyValue( "Align", TextAlign.CENTER );

        // close the table data view
        XCloseable closeSubComponent = UnoRuntime.queryInterface( XCloseable.class, tableView.getFrame() );
        closeSubComponent.close( true );

        // create a query based on that column
        database.getDatabase().getDataSource().createQuery( "q_customers", "SELECT * FROM \"customers\"" );

        // load this query, and verify the table column settings was propagated to the query column
        XFormController queryViewController = UnoRuntime.queryInterface( XFormController.class,
            database.loadSubComponent( DatabaseObject.QUERY, "q_customers" ) );
        tableControlModel = UnoRuntime.queryInterface( XNameAccess.class,
            queryViewController.getCurrentControl().getModel() );
        idColumn = UnoRuntime.queryInterface( XPropertySet.class, tableControlModel.getByName( "ID" ) );

        assertTrue( "table column alignment was not propagated to the query column",
            ((Short)idColumn.getPropertyValue( "Align" )).shortValue() == TextAlign.CENTER );

View Full Code Here

Examples of com.sun.star.form.runtime.XFormController

       
        log.println("enable DesignMode");
        oObj.setFormDesignMode(false);
       
        log.println("test for getFromController() ");
        XFormController xFormCont = oObj.getFormController(xForm);
       
        if (xFormCont == null)
            log.println("ERROR: Could not get FromContoller");
       
        log.println("set back DesignMode to previouse state");
View Full Code Here

Examples of com.sun.star.form.runtime.XFormController

            final XIndexAccess formsCollection = UnoRuntime.queryInterface( XIndexAccess.class,
                m_document.getFormComponentTreeRoot() );
            final XNameAccess form = UnoRuntime.queryInterface( XNameAccess.class, formsCollection.getByIndex(0) );

            final DocumentViewHelper view = m_document.getCurrentView();
            final XFormController formController = view.getFormController( form );
            final XFormOperations formOperations = formController.getFormOperations();

            // move through all records, and check that the display values in the list boxes are as expected
            final String[][] fieldTypesDefinitions = impl_getFieldTypeDefinitions();
            final String[] fieldTypes = fieldTypesDefinitions[0];
View Full Code Here

Examples of com.sun.star.form.runtime.XFormController

       
        log.println("enable DesignMode");
        oObj.setFormDesignMode(false);
       
        log.println("test for getFromController() ");
        XFormController xFormCont = oObj.getFormController(xForm);
       
        if (xFormCont == null)
            log.println("ERROR: Could not get FromContoller");
       
        log.println("set back DesignMode to previouse state");
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.