Package com.sun.star.beans

Examples of com.sun.star.beans.XPropertySet


            UnoRuntime.queryInterface(XShapes.class,the_page);
        XShape oShape =
            SOF.createShape(xDrawDoc, 15000, 13500, 5000, 5000, "OLE2");
        oShapes.add(oShape);

        XPropertySet shape_props = (XPropertySet)
                        UnoRuntime.queryInterface(XPropertySet.class,oShape);

        log.println("Inserting a Chart");

        try {
            shape_props.
                setPropertyValue("CLSID","12DCAE26-281F-416F-a234-c3086127382e");
        } catch (com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't change property", e);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
View Full Code Here


        for (int i = 0; i < fieldCount; ++i)
        {
            try
            {
                Object field = xFields.getByIndex(i);
                XPropertySet propSet = (XPropertySet)UnoRuntime.queryInterface(
                    XPropertySet.class, field);
                DataPilotFieldOrientation orient =
                    (DataPilotFieldOrientation)propSet.getPropertyValue("Orientation");
                if (orient == DataPilotFieldOrientation.DATA)
                {
                    Integer item = new Integer(i);
                    mDataFieldDims.add(item);
                }
View Full Code Here

        _XNamed _xNamed = new _XNamed(xNamed, log, param);
        assure("_getName failed.",_xNamed._getName());
        assure("_setName failed.",_xNamed._setName());

        // _XPropertySet
        XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
                                    XPropertySet.class, mDataPilotFieldObject);
        _XPropertySet _xProp = new _XPropertySet(xProp, log, param);
        assure("_getPropertySetInfo failed.",_xProp._getPropertySetInfo());
        assure("_addPropertyChangeListener failed.",_xProp._addPropertyChangeListener());
        assure("_addVetoableChangeListener failed.",_xProp._addVetoableChangeListener());
View Full Code Here

            UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet);
        XDataPilotTables DPT = DPTS.getDataPilotTables();
        XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor();
        DPDsc.setSourceRange(sCellRangeAdress);

        XPropertySet fieldPropSet = null;
        try {
            Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0);
            fieldPropSet = (XPropertySet)
                UnoRuntime.queryInterface(XPropertySet.class, oDataPilotField);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace();
            throw new StatusException("Couldn't create a test environment", e);
        } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            e.printStackTrace();
            throw new StatusException("Couldn't create a test environment", e);
        }

        try {
            fieldPropSet.setPropertyValue("Function",
                com.sun.star.sheet.GeneralFunction.SUM);
            fieldPropSet.setPropertyValue("Orientation",
                com.sun.star.sheet.DataPilotFieldOrientation.DATA);
        } catch(com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace();
            throw new StatusException("Couldn't create a test environment", e);
        } catch(com.sun.star.lang.IllegalArgumentException e) {
View Full Code Here

                    {
                        XMultiServiceFactory xMSF = _aGTA.getMultiServiceFactory();
                        Object aSettings = xMSF.createInstance( "com.sun.star.sheet.GlobalSheetSettings" );
                        if (aSettings != null)
                        {
                            XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, aSettings );
                            xPropSet.setPropertyValue( "PrintAllSheets", new Boolean( true ) );
                        }
                    }
                   
                    ArrayList aPrintProps = new ArrayList();
                    GlobalLogWriter.get().println("Property FileName:=" + _sPrintFileURL);
View Full Code Here

     *
     * @see com.sun.star.util.NumberFormatSettings
     */
    public void _getNumberFormatSettings() {
        boolean result = true ;
        XPropertySet props = oObj.getNumberFormatSettings();

        if (props != null) {
            try {
              result &= props.getPropertyValue("NullDate") != null &&
                      props.getPropertyValue("StandardDecimals") != null &&
                      props.getPropertyValue("NoZero") != null &&
                      props.getPropertyValue("TwoDigitDateStart") != null ;
            } catch (com.sun.star.beans.UnknownPropertyException e) {
                log.println("Some property doesn't exist") ;
                e.printStackTrace(log) ;
                result = false ;
            } catch (com.sun.star.lang.WrappedTargetException e) {
View Full Code Here

            System.out.println( "jar file = " + jar );
            System.out.println( "rdb file = " + rdb );
       
            // bootstrap service manager
            XMultiServiceFactory xMgr = RegistryServiceFactory.create( rdb );
            XPropertySet xProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xMgr );
            XComponentContext xContext = (XComponentContext)AnyConverter.toObject(
                new Type( XComponentContext.class ), xProps.getPropertyValue( "DefaultContext" ) );
            // insert java loader
            XSet xSet = (XSet)AnyConverter.toObject(
                new Type( XSet.class ), xContext.getServiceManager() );
            xSet.insert( new com.sun.star.comp.loader.JavaLoaderFactory( xMgr ) );
            // get rdb of smgr
            XSimpleRegistry xRDB = (XSimpleRegistry)AnyConverter.toObject(
                new Type( XSimpleRegistry.class ), xProps.getPropertyValue( "Registry" ) );
            // register impl
            XImplementationRegistration xImpReg =
                (XImplementationRegistration)UnoRuntime.queryInterface(
                    XImplementationRegistration.class,
                    xContext.getServiceManager().createInstanceWithContext(
View Full Code Here

                        XStandaloneDocumentInfo.class, oStandaloneDocInfo );
                xStandaloneDocInfo.loadFromURL ( sURL );
                m_aTestHelper.Message ( "StandaloneDocumentInfo loaded." );
               
                //get the title from the object and check it
                XPropertySet xPropSet =
                        (XPropertySet)UnoRuntime.queryInterface (
                        XPropertySet.class, oStandaloneDocInfo );
                String sTitle = xPropSet.getPropertyValue ( "Title" ).toString ();
                m_aTestHelper.Message ( "Get title: " + sTitle );
                if ( sTitle.compareTo ( sDocTitle[i] ) != 0 ) {
                    m_aTestHelper.Error ( "Title not match. Expected \""
                            + sDocTitle[i] +
                            "\"" );
                    return false;
                } else {
                    m_aTestHelper.Message ( "Title matched." );
                }
               
                //set a new title to the object
                sTitle += "_new";
                xPropSet.setPropertyValue ( "Title", sTitle );
                m_aTestHelper.Message ( "Set new title: " + sTitle );
               
                //store the object to the same file
                xStandaloneDocInfo.storeIntoURL ( sURL );
                m_aTestHelper.Message ( "Document info stored." );
               
                //create a new StandaloneDocumentInfo object and load it from the file
                Object oStandaloneDocInfo_ = m_xMSF.createInstance (
                        "com.sun.star.document.StandaloneDocumentInfo" );
                XStandaloneDocumentInfo xStandaloneDocInfo_ =
                        (XStandaloneDocumentInfo)UnoRuntime.queryInterface (
                        XStandaloneDocumentInfo.class, oStandaloneDocInfo_ );
                xStandaloneDocInfo_.loadFromURL ( sURL );
                m_aTestHelper.Message ( "New StandaloneDocumentInfo loaded." );
               
                //get the title and check it
                XPropertySet xPropSet_ = (XPropertySet)UnoRuntime.queryInterface (
                        XPropertySet.class, oStandaloneDocInfo_ );
                String sTitle_ = xPropSet_.getPropertyValue ( "Title" ).toString ();
                m_aTestHelper.Message ( "Get new title: " + sTitle_ );
                if ( sTitle_.compareTo ( sTitle ) != 0 ) {
                    m_aTestHelper.Error ( "New title not matched. Expected: \"" + sTitle
                            + "\"." );
                    return false;
View Full Code Here

    */
    public void createQuery( String _name, String _sqlCommand, boolean _escapeProcessing ) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
    {
        XSingleServiceFactory queryDefsFac = (XSingleServiceFactory)UnoRuntime.queryInterface(
            XSingleServiceFactory.class, getQueryDefinitions() );
        XPropertySet queryDef = null;
        try
        {
            queryDef = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, queryDefsFac.createInstance() );
            queryDef.setPropertyValue( "Command", _sqlCommand );
            queryDef.setPropertyValue( "EscapeProcessing", new Boolean( _escapeProcessing ) );
        }
        catch( com.sun.star.uno.Exception e )
        {
            e.printStackTrace( System.err );
        }
View Full Code Here

    public String getName()
    {
        String name = null;
        try
        {
            XPropertySet dataSourceProps = (XPropertySet) UnoRuntime.queryInterface(
            XPropertySet.class, m_dataSource );
            name = (String)dataSourceProps.getPropertyValue("Name");
        }
        catch (Exception ex)
        {
            Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex);
        }
View Full Code Here

TOP

Related Classes of com.sun.star.beans.XPropertySet

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.