Package com.sun.star.container

Examples of com.sun.star.container.XEnumeration


     */
    private void compareWindowPositions(){
        System.out.println("all frames:########");
        System.out.println(windowsPosSize.entrySet().toString());
       
        XEnumeration allComp = DesktopTools.getAllComponents(xMSF);
       
        String msg=null;
       
        while (allComp.hasMoreElements()){
            try{
                // get all components from the desktop
                XComponent xComponent = (XComponent) UnoRuntime.queryInterface(
                                       XComponent.class, allComp.nextElement());

                XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent);

                String frameName = xModel.getCurrentController().getFrame().getName();

View Full Code Here


        }

        // Enumeration
        XEnumerationAccess oEnumA = (XEnumerationAccess)
            UnoRuntime.queryInterface( XEnumerationAccess.class, oText );
        XEnumeration oEnum = oEnumA.createEnumeration();

        int n = 0;
        while ( (oEnum.hasMoreElements()) ) {
            try {
                    param = (XInterface) AnyConverter.toObject(
                        new Type(XInterface.class),oEnum.nextElement());
            } catch ( Exception e) {
                log.println("Couldn't get Paragraph");
                e.printStackTrace();
                throw new StatusException( "Couldn't get Paragraph", e );
            }
             n++;
        }

        XEnumerationAccess oEnumP = (XEnumerationAccess)
            UnoRuntime.queryInterface( XEnumerationAccess.class, param );
        XEnumeration oEnum2 = oEnumP.createEnumeration();

        log.println( "creating a new environment for TextPortionEnumeration object" );
        TestEnvironment tEnv = new TestEnvironment( oEnum2 );

        log.println("adding ObjRelation ENUM for XEnumeration");
View Full Code Here

                        "com.sun.star.reflection.theTypeDescriptionManager");
            // the manager contains all providers
            XEnumerationAccess aProviderAccess = (XEnumerationAccess)
                        UnoRuntime.queryInterface(XEnumerationAccess.class, o);
            // collect enumeration
            XEnumeration xProviderEnum;
            if (aProviderAccess.hasElements())
                xProviderEnum = aProviderAccess.createEnumeration();
            else
                throw new lib.StatusException(Status.failed(
                                        "No TypeDescriptionProvider given"));
            // take the first registry type description provider
            oInterface = xProviderEnum.nextElement();
            oObj = (XInterface) AnyConverter.toObject(
                            new Type(XInterface.class),oInterface);
        }
        catch( com.sun.star.uno.Exception e ) {
            log.println("Service not available" );
View Full Code Here

                        "com.sun.star.reflection.theTypeDescriptionManager");
            // the manager contains all providers
            XEnumerationAccess aProviderAccess = (XEnumerationAccess)
                        UnoRuntime.queryInterface(XEnumerationAccess.class, o);
            // collect enumeration
            XEnumeration xProviderEnum;
            if (aProviderAccess.hasElements())
                xProviderEnum = aProviderAccess.createEnumeration();
            else
                throw new lib.StatusException(Status.failed(
                                        "No TypeDescriptionProvider given"));
            // take the first registry type description provider
            oInterface = xProviderEnum.nextElement();
            oObj = (XInterface) AnyConverter.toObject(
                            new Type(XInterface.class),oInterface);
        }
        catch( com.sun.star.uno.Exception e ) {
            log.println("Service not available" );
View Full Code Here

        }
       
        // Enumeration
        XEnumerationAccess oEnumA = (XEnumerationAccess)
        UnoRuntime.queryInterface(XEnumerationAccess.class, oText );
        XEnumeration oEnum = oEnumA.createEnumeration();
       
        try {
            para = (XInterface) AnyConverter.toObject(
            new Type(XInterface.class),oEnum.nextElement());
            XEnumerationAccess oEnumB = (XEnumerationAccess)
            UnoRuntime.queryInterface( XEnumerationAccess.class, para );
            XEnumeration oEnum2 = oEnumB.createEnumeration();
            port = (XInterface) AnyConverter.toObject(
            new Type(XInterface.class),oEnum2.nextElement());
        } catch ( com.sun.star.lang.WrappedTargetException e ) {
            e.printStackTrace(log);
            log.println("Error: exception occured...");
        } catch ( com.sun.star.container.NoSuchElementException e ) {
            e.printStackTrace(log);
View Full Code Here

        try {
            XSet set = (XSet) UnoRuntime.queryInterface
                (XSet.class, oInterface) ;
            XSet set1 = (XSet) UnoRuntime.queryInterface
                (XSet.class, srvMan) ;
            XEnumeration oEnum = set1.createEnumeration();
            Object srv = oEnum.nextElement();

            set.insert(srv) ;

            newElement = oEnum.nextElement();

            XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
                                            XPropertySet.class, oInterface);
            if (xProp != null) {
                xContext = (XComponentContext) AnyConverter.toObject(
View Full Code Here

                {
                    NamedValue[] aRequest = new NamedValue[2];
                    aRequest[0] = new NamedValue( "Type", aTypeName );
                    aRequest[1] = new NamedValue( "DocumentService", aDocServiceName );
                   
                    XEnumeration xSet = xQuery.createSubSetEnumerationByProperties( aRequest );
                    if ( xSet != null )
                    {
                        boolean bAcceptable = false;
                        while ( xSet.hasMoreElements() && !bAcceptable )
                        {
                            PropertyValue[] pFilterProps = ( PropertyValue[] )AnyConverter.toArray( xSet.nextElement() );
                            if ( pFilterProps != null )
                            {
                                int nLen = pFilterProps.length;
                                String aTmpFilter = null;
View Full Code Here

                bOK = false;
            }
        }
       
        log.println("create enumeration...");
        XEnumeration xEnum = oObj.createSelectionEnumeration();
       
        boolean compRes = true; //compare result
        int i = 0;
       
        while (xEnum.hasMoreElements()){
            log.println("try to get first element..");
            Object nextElement = null;
            try {
                nextElement = xEnum.nextElement();
            } catch (WrappedTargetException ex) {
                log.println("ERROR: could not get nextElement: " + ex.toString());
                bOK = false;
            } catch (NoSuchElementException ex) {
                log.println("ERROR: could not get nextElement: " + ex.toString());
View Full Code Here

                bOK = false;
            }
        }
       
        log.println("create enumeration...");
        XEnumeration xEnum = oObj.createSelectionEnumeration();
       
        boolean compRes = true; //compare result
        int i = selections.length - 1;
       
        while (xEnum.hasMoreElements()){
            log.println("try to get first element..");
            Object nextElement = null;
            try {
                nextElement = xEnum.nextElement();
            } catch (WrappedTargetException ex) {
                log.println("ERROR: could not get nextElement: " + ex.toString());
                bOK = false;
            } catch (NoSuchElementException ex) {
                log.println("ERROR: could not get nextElement: " + ex.toString());
View Full Code Here

        return result;
    }
   
    protected boolean closeAllWindows(XDesktop desk) {
        XEnumerationAccess compEnumAccess = desk.getComponents();
        XEnumeration compEnum = compEnumAccess.createEnumeration();
        boolean res = true;
       
        try {
            while (compEnum.hasMoreElements()) {
                XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
                XCloseable.class,
                compEnum.nextElement());
               
                if (closer != null) {
                    closer.close(true);
                }
            }
View Full Code Here

TOP

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

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.