Package com.sun.star.uno

Examples of com.sun.star.uno.Any


            assertEquals(null, t.transportAny(new TestPolyStruct()).member);
            assertEquals(
                Any.VOID, t.transportAny(new TestPolyStruct(Any.VOID)).member);
            assertEquals(null, t.transportAny(new TestPolyStruct(null)).member);
            assertEquals(
                new Any(Type.UNSIGNED_LONG, new Integer(5)),
                t.transportAny(
                    new TestPolyStruct(
                        new Any(Type.UNSIGNED_LONG, new Integer(5)))).member);

            assertEquals(
                TestEnum.VALUE1, t.transportEnum(new TestPolyStruct()).member);
            assertEquals(
                TestEnum.VALUE1,
View Full Code Here


    */
    protected Any getWrappedWindowHandle()
    {
               
        NamedValue window = new NamedValue(
            "WINDOW", new Any(new Type(Long.class), new Long(getNativeWindow())));
        NamedValue xembed = new NamedValue(
            "XEMBED", new Any(new Type(Boolean.class), new Boolean(false)));

        if (getNativeWindowSystemType() == SystemDependent.SYSTEM_XWINDOW )
        {
            String vendor = System.getProperty("java.vendor");
            if (vendor.equals("Sun Microsystems Inc.")
                && Boolean.valueOf(System.getProperty("sun.awt.xembedserver")).booleanValue())
            {
                xembed = new NamedValue(
                    "XEMBED",
                    new Any(new Type(Boolean.class), new Boolean(true)));
            }
        }
        return new Any(
            new Type("[]com.sun.star.beans.NamedValue"),
            new NamedValue[] {window, xembed});
    }
View Full Code Here

        }
        XIdlField2 f = UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object[] o = new Object[] {
                new Any(type, UnoRuntime.queryInterface(type, object)) };
        Object v = wrapValue(
            value,
            UnoRuntime.queryInterface(
                XIdlField2.class, idlClass.getField(name)).getType(),
            (p.property.Attributes & PropertyAttribute.MAYBEAMBIGUOUS) != 0,
View Full Code Here

        XIdlField2 field = UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object value;
        try {
            value = field.get(
                new Any(type, UnoRuntime.queryInterface(type, object)));
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            throw new RuntimeException(
                "unexpected com.sun.star.lang.IllegalArgumentException: "
                + e.getMessage());
        } catch (WrappedTargetRuntimeException e) {
View Full Code Here

            }
            if ( result == null )
            {
                LogUtils.DEBUG( "Got Nothing Back" );
                // in the case where there is no return type
                Any voidAny = new Any(new Type(), null);
                result = voidAny;
            }
            else
            {
                LogUtils.DEBUG( "Got object " + result );
View Full Code Here

        // null must not be returned. Either a void any is returned or an any containing
        // an interface type and a null reference.
        if (ret == null)
        {
            if (prop.Type.getTypeClass() == TypeClass.INTERFACE)
                ret= new Any(prop.Type, null);
            else
                ret= new Any(new Type(void.class), null);
        }
        return ret;
    }
View Full Code Here

                            // We try to get an XInterface of setVal and set an XInterface type.
                            if (setVal instanceof XInterface)  
                            {
                                XInterface xint= UnoRuntime.queryInterface(XInterface.class, setVal);
                                if (xint != null)
                                    convObj= new Any(new Type(XInterface.class), xint);
                            }
                            // The member is an any, and the past in argument was null reference (MAYBEVOID is set)
                            else if (setVal == null)
                            {
                                // if the any member is still null we create a void any
                                if (curVal[0] == null)
                                    convObj= new Any(new Type(), null);
                                else
                                {
                                    //otherwise we create an Any with the same type as a value of null;
                                    convObj= new Any( ((Any)curVal[0]).getType(), null);
                                }
                            }
                            else
                                convObj= new Any(new Type(setVal.getClass()), setVal);
                        }
                    }
                    else
                        convObj= convert(memberClass, setVal);
                    newVal[0]= convObj;
View Full Code Here

        // On the wire (at least in URP), the result of queryInterface is
        // transported as an ANY, but in Java it shall be transported as a
        // direct reference to the UNO object (represented as a Java Object),
        // never boxed in a com.sun.star.uno.Any:
        if (operation.equals("queryInterface") && result instanceof Any) {
            Any a = (Any) result;
            if (a.getType().getTypeClass() == TypeClass.INTERFACE) {
                result = a.getObject();
            } else {
                result = null; // should never happen
            }
        }
View Full Code Here

        aOutParamIndex[0][0] = nInParamCount;
        aOutParam[0] = new Object[1];
        aOutParam[0][0] = aScoreArray;
      }

      Any aRetAny = new Any( new Type( String[].class ), aRet );
      return aRetAny;
    }
View Full Code Here

            XIndexAccess params = req.Parameters;
            int count = params.getCount();
            try {
                for(int i=0; i<count; i++) {
                    Object aObject = params.getByIndex(i);
                    Any any = (Any)aObject;
                    log.println("### _XCompletedExecution.InteractionHandlerImpl: Parameter "+i+": "+params.getByIndex(i));
                    XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, params.getByIndex(i));
                    log.println("### _XCompletedExecution.InteractionHandlerImpl: Parameter Name: '"+xProp.getPropertyValue("Name") + "' is set to Value '1'");
                    xProp.setPropertyValue("Value", new Integer(1));
                    handlerWasUsed = true;
View Full Code Here

TOP

Related Classes of com.sun.star.uno.Any

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.