Examples of XNameReplace


Examples of com.sun.star.container.XNameReplace

                    failed("could not get test object", CONTINUE);
                }
               
                xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oObj);
                XNameContainer xNC = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oObj);
                XNameReplace xNR = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class, oObj);
                XFlushable xFlush = (XFlushable) UnoRuntime.queryInterface(XFlushable.class, oObj);

                instance = (Object[]) xNA.getByName(filterName);
                PropertyValue[] props = (PropertyValue[]) instance;
               
                printPropertyValues(props);
               
                boolean isMandatory = ((Boolean) getPropertyValueValue(props, "Mandatory")).booleanValue();
                boolean isFinalized = ((Boolean) getPropertyValueValue(props, "Finalized")).booleanValue();
               
                // memory if every state is available
                mandantoryTrue |= isMandatory;
                mandantoryFalse |= !isMandatory;
               
                finalizedTrue |= isFinalized;
                finalizedFalse |= !isFinalized;
               
                //change the filter
                setPropertyValueValue((PropertyValue[])instance, "UIName", "dummy");
               
                // 1a.) try to change the filter in the container
                try{
                    xNR.replaceByName(filterName, instance);
                }catch (IllegalArgumentException e){
                    failed("could not replace filter properties ('" + filterName + "')", CONTINUE);
                }
               
                // 1b.) try to wirte the changed filter to the configuration.
View Full Code Here

Examples of com.sun.star.container.XNameReplace

        try {
            ConfigHelper aConfig = new ConfigHelper(xMSF,
                                    "org.openoffice.Office.Views", false);
           
            // Is node "5539" (slot-id for navigator) available? If not, insert it
            XNameReplace x5539 = aConfig.getOrInsertGroup("Windows", "5539");
           
            aConfig.updateGroupProperty(
               "Windows""5539", "WindowState", "952,180,244,349;1;0,0,0,0;");
           
            aConfig.insertOrUpdateExtensibleGroupProperty(
View Full Code Here

Examples of com.sun.star.container.XNameReplace

    {
        try
        {
            Object xOtherViewRoot = createUpdatableView(xKey, false);

            XNameReplace aReplace = (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, xOtherViewRoot);

            String aItemNames [] = aReplace.getElementNames();
            for (int i=0; i < aItemNames.length; ++i) {
                Object aItem = aReplace.getByName( aItemNames [i] );
                AnyConverter aAnyConv = new AnyConverter();
                // replace integers by a 'complement' value
                if ( aAnyConv.isInt(aItem) )
                {
                    int nOld = aAnyConv.toInt(aItem);
                    int nNew = 9999 - nOld;

                    System.out.println("Replacing integer value: " + aItemNames [i]);
                    aReplace.replaceByName( aItemNames [i], new Integer( nNew ) );
                }

                // and booleans by their negated value
                else if ( aAnyConv.isBoolean(aItem) )
                {
                    boolean bOld = aAnyConv.toBoolean(aItem);
                    boolean bNew = ! bOld;

                    System.out.println("Replacing boolean value: " + aItemNames [i]);
                    aReplace.replaceByName( aItemNames [i], new Boolean( bNew ) );
                }
            }

            // commit the changes
            XChangesBatch xUpdateControl =
View Full Code Here

Examples of com.sun.star.container.XNameReplace

        assertEquals( "undo context was not auto-closed as expected", 0, m_undoListener.getCurrentUndoContextDepth() );

        // .............................................................................................................
        // scenario 3: assigning the script to some document event, and triggering this event
        final XEventsSupplier eventSupplier = UnoRuntime.queryInterface( XEventsSupplier.class, m_currentDocument.getDocument() );
        final XNameReplace events = UnoRuntime.queryInterface( XNameReplace.class, eventSupplier.getEvents() );
        final NamedValue[] scriptDescriptor = new NamedValue[] {
            new NamedValue( "EventType", "Script" ),
            new NamedValue( "Script", scriptURI )
        };
        events.replaceByName( "OnViewCreated", scriptDescriptor );

        // The below doesn't work: event notification is broken in m96, see http://www.openoffice.org/issues/show_bug.cgi?id=116313
        m_callbackCalled = false;
        m_currentDocument.getCurrentView().dispatch( ".uno:NewWindow" );
        assertTrue( "triggering an event did not work as expected - basic script not called", m_callbackCalled );
View Full Code Here

Examples of com.sun.star.container.XNameReplace

        nodepath.Value = "org.openoffice.Office.Common";
        nodepath.Handle = -1;
        nodepath.State = PropertyState.DEFAULT_VALUE;
        nodeArgs[0] = nodepath;

        XNameReplace updateAccess = null;
        try {
            XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
                                                     .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
            XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
                                                XMultiServiceFactory.class,
View Full Code Here

Examples of com.sun.star.container.XNameReplace

        nodepath.Handle = -1;
        nodepath.State = PropertyState.DEFAULT_VALUE;
        nodeArgs[0] = nodepath;

        XNameAccess xHierachNameAccess = null;
        XNameReplace xChangeView = null;
        XComponent xDisposeComponent = null;
       
        try {
            XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
                                                     .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
View Full Code Here

Examples of com.sun.star.container.XNameReplace

        nodepath.Value = "org.openoffice.Office.Jobs";
        nodepath.Handle = -1;
        nodepath.State = PropertyState.DEFAULT_VALUE;
        nodeArgs[0] = nodepath;

        XNameReplace updateAccess = null;
        try {
            XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
                                                     .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
            XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
                                                XMultiServiceFactory.class,
View Full Code Here

Examples of com.sun.star.container.XNameReplace

    {
        try
        {
            Object xOtherViewRoot = createUpdatableView(xKey, false);

            XNameReplace aReplace = (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, xOtherViewRoot);

            String aItemNames [] = aReplace.getElementNames();
            for (int i=0; i < aItemNames.length; ++i) {
                Object aItem = aReplace.getByName( aItemNames [i] );
                AnyConverter aAnyConv = new AnyConverter();
                // replace integers by a 'complement' value
                if ( aAnyConv.isInt(aItem) )
                {
                    int nOld = aAnyConv.toInt(aItem);
                    int nNew = 9999 - nOld;

                    System.out.println("Replacing integer value: " + aItemNames [i]);
                    aReplace.replaceByName( aItemNames [i], new Integer( nNew ) );
                }

                // and booleans by their negated value
                else if ( aAnyConv.isBoolean(aItem) )
                {
                    boolean bOld = aAnyConv.toBoolean(aItem);
                    boolean bNew = ! bOld;

                    System.out.println("Replacing boolean value: " + aItemNames [i]);
                    aReplace.replaceByName( aItemNames [i], new Boolean( bNew ) );
                }
            }

            // commit the changes
            XChangesBatch xUpdateControl =
View Full Code Here

Examples of com.sun.star.container.XNameReplace

        nodeArgs[0] = nodepath;
       
        String hierarchicalElementName = "Labels['Avery A4']";
        String elementName = "Avery A4";

        XNameReplace xChangeView = null;
        XNameContainer xContainer = null;
        XHierarchicalNameAccess xHierachNameAccess = null;
        try {
            XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
                                                     .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
View Full Code Here

Examples of com.sun.star.container.XNameReplace

        try {
            ConfigHelper aConfig = new ConfigHelper(xMSF,
                                    "org.openoffice.Office.Views", false);
           
            // Is node "5539" (slot-id for navigator) available? If not, insert it
            XNameReplace x5539 = aConfig.getOrInsertGroup("Windows", "5539");
           
            aConfig.updateGroupProperty(
               "Windows""5539", "WindowState", "952,180,244,349;1;0,0,0,0;");
           
            aConfig.insertOrUpdateExtensibleGroupProperty(
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.