Package com.sun.star.container

Examples of com.sun.star.container.XIndexContainer


     */
    public void _ImageMap() {
        boolean result = true;

        try {
            XIndexContainer imgMap = (XIndexContainer) UnoRuntime.queryInterface(
                                             XIndexContainer.class,
                                             oObj.getPropertyValue("ImageMap"));
            int previous = imgMap.getCount();
            log.println("Count (previous) " + previous);

            Object im = tEnv.getObjRelation("IMGMAP");
            imgMap.insertByIndex(0, im);
            oObj.setPropertyValue("ImageMap", imgMap);
            imgMap = (XIndexContainer) UnoRuntime.queryInterface(
                             XIndexContainer.class,
                             oObj.getPropertyValue("ImageMap"));

            int after = imgMap.getCount();
            log.println("Count (after) " + after);
            result = previous < after;
        } catch (Exception ex) {
            result = false;
        }
View Full Code Here


                tRes.tested("ImageMap", false);
                return;
            }

            Object o = oObj.getPropertyValue("ImageMap");
            XIndexContainer xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, o);
            util.dbg.printInterfaces(xIndexContainer);
            int elementCountFirst = xIndexContainer.getCount();
            xIndexContainer.insertByIndex(elementCountFirst, imapObject);

            // this does not really change the property: the implementation
            // behind "ImageMap" stays the same, but for a real change a C++
            // implementation is needed. See css.lang.XUnoTunnel
            oObj.setPropertyValue("ImageMap", xIndexContainer);
            Object newObject = oObj.getPropertyValue("ImageMap");
            xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, newObject);

            int elementCountSecond = xIndexContainer.getCount();
            result = (elementCountFirst + 1 == elementCountSecond);
           
            tRes.tested("ImageMap", result);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
            log.println("Exception while checking 'ImageMap'");
View Full Code Here

            tRes.tested("setViewData()", newView.equals(myview));
        }
    }
   
    private void setViewID(XIndexAccess xAccess, String value) {
        XIndexContainer xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xAccess);
        int count = xAccess.getCount();
        try {
            if (count > 0) {
                oldProps = (PropertyValue[])xAccess.getByIndex(0);
                newProps = new PropertyValue[oldProps.length];
                for (int j=0; j<oldProps.length; j++) {
//                    log.println("Name: " + oldProps[j].Name);
//                    log.println("Value: " + oldProps[j].Value.toString());
                    newProps[j] = new PropertyValue();
                    newProps[j].Name = oldProps[j].Name;
                    newProps[j].Handle = oldProps[j].Handle;
                    newProps[j].State = oldProps[j].State;
                    if (oldProps[j].Name.equals("ViewId")) {
                        newProps[j].Value = value;
                    }

                }
                xIndexContainer.insertByIndex(0, newProps);
            }
        }
        catch(Exception e) {
            e.printStackTrace((java.io.PrintWriter)log);
        }
View Full Code Here

      XNameContainer xNameContainer = xCustPresSupplier.getCustomPresentations();
      XSingleServiceFactory xFactory = (XSingleServiceFactory)
        UnoRuntime.queryInterface( XSingleServiceFactory.class, xNameContainer );

      Object      xObj;
      XIndexContainer xContainer;

      /* instanciate an IndexContainer that will take
         a list of draw pages for the first custom show */
      xObj = xFactory.createInstance();
        xContainer = (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xObj );
      for ( i = 5; i < 10; i++ )
        xContainer.insertByIndex( xContainer.getCount(), xDrawPages.getByIndex( i ) );
      xNameContainer.insertByName( "ShortVersion", xContainer );

      /* instanciate an IndexContainer that will take
         a list of draw page for the second custom show */
      xObj = xFactory.createInstance();
        xContainer = (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xObj );
      for ( i = 1; i < 10; i++ )
        xContainer.insertByIndex( xContainer.getCount(), xDrawPages.getByIndex( i ) );
      xNameContainer.insertByName( "LongVersion", xContainer );

      /* which custom show is to use
         can been set in the presentation settings */

 
View Full Code Here

    * Gets glue points collection. <p>
    * Has <b> OK </b> status if the value returned is not null. <p>
    */
    public void _getGluePoints(){
        boolean result = true;
        XIndexContainer points = null;

        log.println("testing getDrawPages() ... ");

        points = oObj.getGluePoints();
        result = points != null;
View Full Code Here

        }

        createMenuBarItem("Click for Macro", (XIndexContainer)UnoRuntime.queryInterface(
                                        XIndexContainer.class, prop[3].Value), log);
       
        XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, mxMenuBarSettings);
        try {
            x.insertByIndex(x.getCount(), prop);
        }
        catch(com.sun.star.lang.IllegalArgumentException e) {
            result = false;
            e.printStackTrace(log);
        }
View Full Code Here

        }

        createMenuBarItem("A new sub entry", (XIndexContainer)UnoRuntime.queryInterface(
                                        XIndexContainer.class, prop[3].Value), log);
       
        XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class,mxSettings);
        try {
            int count = x.getCount();
            x.insertByIndex(count, prop);
        }
        catch(com.sun.star.lang.IllegalArgumentException e) {
            result = false;
            e.printStackTrace(log);
        }
View Full Code Here

        try {
            oInterface = xMSF.createInstance
                ( "com.sun.star.ucb.DataContainer" );

            // adding one child container
            XIndexContainer xIC = (XIndexContainer) UnoRuntime.queryInterface
                (XIndexContainer.class, oInterface) ;

            Object child = xMSF.createInstance
                ( "com.sun.star.ucb.DataContainer" );
            xIC.insertByIndex(0, child) ;

            relationContainer = xMSF.createInstance
                ( "com.sun.star.ucb.DataContainer" );

            xIn = xMSF.createInstance
View Full Code Here

        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get by index", e);
        }

        XIndexContainer aIContainer = (XIndexContainer)
            UnoRuntime.queryInterface(XIndexContainer.class,oInstance);

        try {
            aIContainer.insertByIndex(0, oDrawPage);
        } catch (com.sun.star.lang.WrappedTargetException e){
            e.printStackTrace(log);
            throw new StatusException("Could't insert DrawPage", e);
        } catch (com.sun.star.lang.IllegalArgumentException e){
            e.printStackTrace(log);
View Full Code Here

                PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry(
                                        "Trigger Event", xMenuBarSettings, xMSF, log);
                _XUIConfigurationManager.createMenuBarItem("Click for Macro",
                                (XIndexContainer)UnoRuntime.queryInterface(
                                XIndexContainer.class, prop[3].Value), log);
                XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings);
                x.insertByIndex(x.getCount(), prop);
                xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings);
                xUIManager.reset();
            }
            catch(com.sun.star.container.NoSuchElementException e) {
                log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
View Full Code Here

TOP

Related Classes of com.sun.star.container.XIndexContainer

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.