Package com.sun.star.beans

Examples of com.sun.star.beans.XPropertySetInfo


     */
    public void _FillBitmap() {

        String propName = "FillBitmap";

        XPropertySetInfo info = oObj.getPropertySetInfo();

        if (!info.hasPropertyByName(propName)) {
            if (isOptional(propName)) {
                // skipping optional property test
                log.println("Property '" + propName + "' is optional and not supported");
                tRes.tested(propName, true);
                return;
View Full Code Here


            {
                // get an XPropertySet, here the one of a text cursor
                // XPropertySet xCursorProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, mxDocCursor);
               
                // get the property info interface of this XPropertySet
                XPropertySetInfo xPropsInfo = xProps.getPropertySetInfo();
               
                // get all properties (NOT the values) from XPropertySetInfo
                Property[] aProps = xPropsInfo.getProperties();
                int i;
                for (i = 0; i < aProps.length; ++i) {
                    // number of property within this info object
                    System.out.print("Property #" + i);
                   
View Full Code Here

            XPropertySet.class, xObject);
        if (xSet == null)
            MessageArea.println ("object does not support XPropertySet");
        else
        {
            XPropertySetInfo xInfo = xSet.getPropertySetInfo ();
            Property[] aProperties = xInfo.getProperties ();
            int n = aProperties.length;
            for (int i=0; i<n; i++)
                MessageArea.println (i + " : " + aProperties[i].Name +", " + aProperties[i].Type);
        }
    }
View Full Code Here

    {
        XMultiPropertySet mProps =
            (XMultiPropertySet) UnoRuntime.queryInterface(
                XMultiPropertySet.class, tEnv.getTestObject()
            );
        XPropertySetInfo propertySetInfo = mProps.getPropertySetInfo();
        Property[] properties = propertySetInfo.getProperties();
        getPropsToTest(properties);
        log.println("Changing all properties");

        Object[] gValues = mProps.getPropertyValues(testPropsNames);
View Full Code Here

         * @result - adds the result of testing propName property to
         *           MultiMethodTest.tRes.
         */
        protected void testProperty(String propName)
        {
            XPropertySetInfo info = oObj.getPropertySetInfo();

            if (info != null)
            {
                final boolean bHasProperty = info.hasPropertyByName(propName);
                if (!bHasProperty)
                {
                    if (isOptional(propName) || optionalService)
                    {
                        // skipping optional property test
                        log.println("Property '" + propName + "' is optional and not supported");
                        tRes.tested(propName, true);
                        return;
                    }
                    else
                    {
                        // cannot test the property
                        log.println("Tested XPropertySet does not contain'" + propName + "' property");
                        tRes.tested(propName, false);
                        return;
                    }
                }
            }

            try
            {
                Object oldValue = oObj.getPropertyValue(propName);
               
                if( (oldValue==null) || utils.isVoid(oldValue) )
                {
                    // #i111560# method getNewValue() does not work with an empty oldValue
                    Property prop = info.getPropertyByName(propName);
                    if( (prop.Attributes & PropertyAttribute.MAYBEVOID) != 0 )
                    {
                        // todo: implement a new test independent from method getNewValue()
                        log.println("changing initially empty MAYBEVOID properties is not supported by the test framework so far - skip test of property: " + propName)
                        tRes.tested(propName, true);
View Full Code Here

         */
        protected void checkResult(String propName, Object oldValue,
                Object newValue, Object resValue, Exception exception)
                throws Exception
        {
            XPropertySetInfo info = oObj.getPropertySetInfo();
            if (info == null)
            {
                log.println("Can't get XPropertySetInfo for property " + propName);
                tRes.tested(propName, false);
                return;
            }
            Property prop = info.getPropertyByName(propName);

            short attr = prop.Attributes;
            boolean readOnly = (prop.Attributes & PropertyAttribute.READONLY) != 0;
            boolean maybeVoid = (prop.Attributes & PropertyAttribute.MAYBEVOID) != 0;
            //check get-set methods
View Full Code Here

        xDocText.insertTextContent(xDocTextCursor, xMetaField, true);

        XPropertySet xPropertySet = (XPropertySet)
            UnoRuntime.queryInterface(XPropertySet.class, xMetaField);
        assertNotNull("PropertySet: not supported?", xPropertySet);
        XPropertySetInfo xPropertySetInfo = xPropertySet.getPropertySetInfo();
        assertTrue("hasPropertyByName(\"NumberFormat\"):",
                   xPropertySetInfo.hasPropertyByName("NumberFormat"));
        assertTrue("hasPropertyByName(\"IsFixedLanguage\"):",
                   xPropertySetInfo.hasPropertyByName("IsFixedLanguage"));

        int def = (Integer) xPropertySet.getPropertyValue("NumberFormat");
        System.out.println("NumberFormat: default is " + def);
        short INT = com.sun.star.i18n.NumberFormatIndex.NUMBER_INT;
        xPropertySet.setPropertyValue("NumberFormat", INT);
View Full Code Here

     * @see com.sun.star.beans.XPropertySet
     */
    public static void printPropertyInfo(XPropertySet PS, String name,
                                                        PrintWriter out) {
        try {
            XPropertySetInfo PSI = PS.getPropertySetInfo();
            Property[] props = PSI.getProperties();
            Property prop = PSI.getPropertyByName(name);
            out.println("Property name is " + prop.Name);
            out.println("Property handle is " + prop.Handle);
            out.println("Property type is " + prop.Type.getTypeName());
            out.println("Property current value is " +
                                                    PS.getPropertyValue(name));
View Full Code Here

     * Print the names of all properties inside this property set
     * @param ps The property set which is printed.
     * @see com.sun.star.beans.XPropertySet
     */
    public static void printPropertiesNames(XPropertySet ps) {
            XPropertySetInfo psi = ps.getPropertySetInfo();
            Property[] props = psi.getProperties();
            for (int i = 0; i < props.length; i++)
                    System.out.println(i + ".  " + props[i].Name);
    }
View Full Code Here

    public void removePropertyChangeListener(String name, XPropertyChangeListener l) {
    }

    public XPropertySetInfo getPropertySetInfo() {
        return new XPropertySetInfo() {
            public Property[] getProperties() {
                return props;
            }

            public boolean hasPropertyByName(String name) {
View Full Code Here

TOP

Related Classes of com.sun.star.beans.XPropertySetInfo

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.