Package com.sun.star.beans

Examples of com.sun.star.beans.PropertyValue


        exp = false;
        try {
            log.println("try to set integer value to string property, " +
                "expect 'com.sun.star.lang.IllegalArgumentException'...");
            PropertyValue[] newProps = new PropertyValue[1];
            PropertyValue failedProp = new PropertyValue();
            failedProp.Name = propertyToChange.Name;
            failedProp.Value = new Integer(10);
            newProps[0] = failedProp;
            oObj.setPropertyValues(newProps);
        } catch (PropertyVetoException ex) {
            log.println("ERROR: unexptected exception was thrown while trying to set null value: " +
                ex.toString());
            exp = true;
        } catch (WrappedTargetException ex) {
            log.println("ERROR: unexptected exception was thrown while trying to set null value: " +
                ex.toString());
            exp = true;
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            log.println("OK: exptected exception was thrown while trying to set null value: " +
                ex.toString());
            test = true;
            exp = true;
        } catch (UnknownPropertyException ex) {
            log.println("ERROR: unexptected exception was thrown while trying to set null value: " +
                ex.toString());
            exp = true;
        }
       
        if (! exp){
            log.println("FAILED: expected exception 'UnknownPropertyException' was not thrown");
        } else {
            if (test) log.println("... OK");
        }
       
        ok &= test;
        test = false;
        exp = false;
        try {
           
            log.println("try to set values with invalid property name. " +
                "Expect 'com.sun.star.beans.UnknownPropertyException'...");
           
            PropertyValue[] newProps = new PropertyValue[1];
            PropertyValue newProp = new PropertyValue();
            newProp.Name = "XPropertyAccess.InvalidPropertyName";
            newProp.Value = "invalid property";
            newProps[0] = newProp;
           
            oObj.setPropertyValues(newProps);
View Full Code Here


            elementCount = xDrawPage.getCount();
        }
       
        // switch off the automatic refresh
        PropertyValue[] props = new PropertyValue[1];
        props[0] = new PropertyValue();
        props[0].Name = "AutoRefreshArrows";
        props[0].Value = Boolean.FALSE;
        XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, oObj);
        dispatch(xModel.getCurrentController().getFrame(), (XMultiServiceFactory)tParam.getMSF(), ".uno:AutoRefreshArrows", props);
View Full Code Here

    }
   
    public void after() {
        // switch the automatic refresh back on
        PropertyValue[] props = new PropertyValue[1];
        props[0] = new PropertyValue();
        props[0].Name = "AutoRefreshArrows";
        props[0].Value = Boolean.TRUE;
        XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, oObj);
        dispatch(xModel.getCurrentController().getFrame(), (XMultiServiceFactory)tParam.getMSF(), ".uno:AutoRefreshArrows", props);
    }
View Full Code Here

         */
        public MyPrintJobListener(Object printable, String printFileName) {
            this.printFileName = printFileName;
            xPrintable = (XPrintable)UnoRuntime.queryInterface(XPrintable.class, printable);
            printProps = new PropertyValue[2];
            printProps[0] = new PropertyValue();
            printProps[0].Name = "FileName";
            printProps[0].Value = printFileName;
            printProps[0].State = com.sun.star.beans.PropertyState.DEFAULT_VALUE;
            printProps[1] = new PropertyValue();
            printProps[1].Name = "Wait";
            printProps[1].Value = new Boolean(true);
        }
View Full Code Here

        URL dispURL = utils.parseURL((XMultiServiceFactory) tParam.getMSF(), ".uno:InsertText");
       
        XDispatch xDisp = xDispProv.queryDispatch(dispURL,"",0);

        PropertyValue[] args = new PropertyValue[1];
        args[0] = new PropertyValue();
        args[0].Name = "Text";
        args[0].Value = "XDispatchRecorderSupplier";

        log.print("Dispatching and recording ...");
        oObj.dispatchAndRecord(dispURL, args, xDisp);
View Full Code Here

            String frameName = "_blank";
            XComponent oDoc = null;
           
            log.println("load writer doc that contains links");
            PropertyValue [] szArgs = new PropertyValue [1];
            PropertyValue Arg = new PropertyValue();
            Arg.Name = "UpdateDocMode";
            Arg.Value = new Short(com.sun.star.document.UpdateDocMode.NO_UPDATE);
            szArgs[0]=Arg;
            String url = util.utils.getFullTestURL("Writer_link.sxw");
            log.println("try to load '" + url + "'");
View Full Code Here

        urlS[0] = new URL();
        urlS[0].Complete = url;
        boolean res = xURLTrans.parseStrict(urlS);
        log.println("Parsing URL '" + url + "': " + res);
        descr = new PropertyValue[1] ;
        descr[0] = new PropertyValue();
        descr[0].Name = "URL" ;
        descr[0].Value = urlS[0] ;
    }
View Full Code Here

     *      this entry is added.
     */
    public static void createMenuBarItem(String sLabelName, XIndexContainer xDescriptionContainer, PrintWriter log) {
        PropertyValue[]aMenuItem = new PropertyValue[3];
        // create a menu item
        aMenuItem[0] = new PropertyValue();
        aMenuItem[0].Name = "CommandURL";
        aMenuItem[0].Value = "macro:///Standard.Module1.Test()";
        aMenuItem[1] = new PropertyValue();
        aMenuItem[1].Name = "Label";
        aMenuItem[1].Value = sLabelName;
        aMenuItem[2] = new PropertyValue();
        aMenuItem[2].Name = "Type";
        aMenuItem[2].Value = new Short((short)0);

        try {
            xDescriptionContainer.insertByIndex(0, aMenuItem);
View Full Code Here

                    printLevelFormatProperty(oldValue);

                    newVal = new PropertyValue[1][2];

                    for (int i = 0; i < newVal[0].length; i++) {
                        newVal[0][i] = new PropertyValue();
                    }

                    newVal[0][1].Name = "TokenType";
                    newVal[0][1].Value = "TokenEntryText";
                    newVal[0][0].Name = "Text";
View Full Code Here

        log.println("opening dialog");
       
        PropertyValue[] args = new PropertyValue[1];
        try {
            args[0] = new PropertyValue();
            args[0].Name = "InteractionHandler";
            args[0].Value = ((XMultiServiceFactory)Param.getMSF()).createInstance(
                "com.sun.star.comp.uui.UUIInteractionHandler");
        } catch(com.sun.star.uno.Exception e) {
        }
View Full Code Here

TOP

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

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.