Package com.sun.star.container

Examples of com.sun.star.container.XEnumeration


    }
   
   
    public void updateDateFields() {
        try {
            XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();
            Calendar cal = new GregorianCalendar();
            DateTime dt = new DateTime();
            dt.Day = (short) cal.get(Calendar.DAY_OF_MONTH);
            dt.Year = (short) cal.get(Calendar.YEAR);
            dt.Month = (short) cal.get(Calendar.MONTH);
            dt.Month++;
           
            while (xEnum.hasMoreElements()) {
                Object oTextField = xEnum.nextElement();           
                XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
               
                if (xSI.supportsService("com.sun.star.text.TextField.DateTime")) {
                    XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTextField);
                    xPSet.setPropertyValue("IsFixed", Boolean.FALSE);
View Full Code Here


        }
    }

    public void fixDateFields(boolean _bSetFixed) {
    try {
        XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();           
        while (xEnum.hasMoreElements()) {
            Object oTextField = xEnum.nextElement();           
            XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
            if (xSI.supportsService("com.sun.star.text.TextField.DateTime")) {
                XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTextField);
                xPSet.setPropertyValue("IsFixed", new Boolean(_bSetFixed));
            }
View Full Code Here

    try {
        XDependentTextField[] xDependentFields;
        Vector xDependentVector = new Vector();
        if (xTextFieldsSupplier.getTextFields().hasElements()) {
            XPropertySet xPSet;
            XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();
            while (xEnum.hasMoreElements()) {
                Object oTextField = xEnum.nextElement();
                XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField);
                xPSet = xDependent.getTextFieldMaster();
                if (xPSet.getPropertySetInfo().hasPropertyByName(_PropertyName)){
                    Object oValue = xPSet.getPropertyValue(_PropertyName);
                    // TODO replace the following comparison via com.sun.star.uno.Any.Type
View Full Code Here

    }
   
   
    public void updateDocInfoFields() {
        try {
            XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();
            while (xEnum.hasMoreElements()) {
                Object oTextField = xEnum.nextElement();           
                XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
               
                if (xSI.supportsService("com.sun.star.text.TextField.ExtendedUser")) {                 
                    XUpdatable xUp = (XUpdatable) UnoRuntime.queryInterface(XUpdatable.class, oTextField);
                    xUp.update();                      
View Full Code Here

    * Test calls the method. Then elements enumeration is created and tested.<p>
    * Has <b> OK </b> status if no exceptions were thrown.
    */
    public void _getComponents() {
        XEnumerationAccess xComps = oObj.getComponents();
        XEnumeration xEnum = xComps.createEnumeration();
        boolean result = false;

        try {
            for (; xEnum.hasMoreElements();) {
                XInterface xInt = null;
                try {
                    xInt = (XInterface) AnyConverter.toObject(
                            new Type(XInterface.class), xEnum.nextElement());
                } catch (com.sun.star.lang.IllegalArgumentException iae) {
                    log.println("Can't convert any");
                }
            }
            result = true;
View Full Code Here

    * Has <b> OK </b> status if gained enumeration has elements. <p>
    */
    public void _getCells() {
        log.println("Testing getCells ...");

        XEnumeration oEnum = oObj.getCells().createEnumeration();
        boolean res = oEnum.hasMoreElements();
        if (!res) {
            log.println(
                    "The Enumeration gained via getCells() has no Elements");
        }
        tRes.tested("getCells()", res);
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

        }

        boolean bResult = true;

        log.println( "creating Enumeration" );
        XEnumeration oEnum = oObj.createContentEnumeration(serviceNames[0]);
        bResult &= oEnum != null;

        tRes.tested( "createContentEnumeration()",  bResult);
    }
View Full Code Here

    * Test calls the method and checks return value. <p>
    * Has <b> OK </b> status if the method returns not null value. <p>
    */
    public void _createEnumeration(){
        log.println( "createing Enumeration" );
        XEnumeration oEnum = oObj.createEnumeration();
        tRes.tested( "createEnumeration()", oEnum != null );
        return;
    } // end createEnumeration()
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.