Package com.sun.star.beans

Examples of com.sun.star.beans.PropertyValue


    public static void attachEventCall(XComponent xComponent, String EventName, String EventType, String EventURL) {
        try {
            XEventsSupplier xEventsSuppl = (XEventsSupplier) UnoRuntime.queryInterface(XEventsSupplier.class, xComponent);
            PropertyValue[] oEventProperties = new PropertyValue[2];
            oEventProperties[0] = new PropertyValue();
            oEventProperties[0].Name = "EventType";
            oEventProperties[0].Value = EventType; // "Service", "StarBasic"
            oEventProperties[1] = new PropertyValue();
            oEventProperties[1].Name = "Script"; //"URL";
            oEventProperties[1].Value = EventURL;
            xEventsSuppl.getEvents().replaceByName(EventName, oEventProperties);
        } catch (Exception exception) {
            exception.printStackTrace(System.out);
View Full Code Here


     * @return the document Component (implements XComponent) object ( XTextDocument, or XSpreadsheedDocument
     */
    public static Object createNewDocument(XFrame frame, String sDocumentType, boolean preview, boolean readonly) {
       
        PropertyValue[] loadValues = new PropertyValue[2];
        loadValues[0] = new PropertyValue();
        loadValues[0].Name = "ReadOnly";
        loadValues[0].Value = readonly ? Boolean.TRUE : Boolean.FALSE;
        loadValues[1] = new PropertyValue();
        loadValues[1].Name = "Preview";
        loadValues[1].Value = preview ? Boolean.TRUE : Boolean.FALSE;
       
        Object oDocument = null;
        com.sun.star.frame.XComponentLoader xComponentLoader = null;
View Full Code Here

        try {
            XStorable xStoreable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xComponent);
            PropertyValue[] oStoreProperties;
            if (FilterName.length() > 0) {
                oStoreProperties = new PropertyValue[1];
                oStoreProperties[0] = new PropertyValue();
                oStoreProperties[0].Name = "FilterName";
                oStoreProperties[0].Value = FilterName;
            } else
                oStoreProperties = new PropertyValue[0];
            if (bStoreToUrl == true)
View Full Code Here

        xDispatch.dispatch(openHyperlink, loadArgs); //Dispatch.dispatch(openHyperlink, loadArgs);     
    }


    private PropertyValue[] loadArgs(String url) {
        PropertyValue pv = new PropertyValue();
        pv.Name = "URL";
        pv.Value = url;
        return new PropertyValue[] {pv};
    }      
View Full Code Here

        throws Exception
    {
        Object typeDetect = xmsf.createInstance("com.sun.star.document.TypeDetection");
       
        PropertyValue[][] mediaDescr = new PropertyValue[1][1];
        mediaDescr[0][0] = new PropertyValue();
        mediaDescr[0][0].Name = "URL";
        mediaDescr[0][0].Value = url;
   
        String type = ((XTypeDetection)UnoRuntime.queryInterface(XTypeDetection.class, typeDetect)).queryTypeByDescriptor(mediaDescr, true);
       
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

            XCommandProcessor xFolderCommandProcessor = (XCommandProcessor)UnoRuntime.queryInterface(XCommandProcessor.class, xNewFolder);
            log.println("Got the new folder: " + utils.getImplName(xNewFolder));

            // name the new folder
            PropertyValue[] titleProp = new PropertyValue[1];
            titleProp[0] = new PropertyValue();
            titleProp[0].Name = "Title";
            titleProp[0].Handle = -1;
            titleProp[0].Value = folderName;
            Command titleSetCommand = new Command();
            titleSetCommand.Name = "setPropertyValues";
View Full Code Here

            String url = "jdbc:mysql://localhost:3306/mysql?user=root";
            //String url = "jdbc:ingres://localhost:II7/demodb;AUTO=multi";
            com.sun.star.sdbc.XConnection xConnection = null;
            com.sun.star.beans.PropertyValue prop[] = new PropertyValue[1];
            prop[0] = new PropertyValue("JavaDriverClass", 0, "com.mysql.jdbc.Driver", PropertyState.DIRECT_VALUE);
            //prop[0] = new PropertyValue("JavaDriverClass", 0, "com.ingres.jdbc.IngresDriver", PropertyState.DIRECT_VALUE);

            // get the remote office component context
            XMultiServiceFactory xServiceManager = (XMultiServiceFactory) param.getMSF();
            Object x = xServiceManager.createInstance("com.sun.star.sdbc.DriverManager");
View Full Code Here

                                                XNameContainer.class, oObj);

        assure("XNameContainer was queried but returned null.",
                                                        (xCont != null));
        PropertyValue[] prop1 = new PropertyValue[1];
        prop1[0] = new PropertyValue();
        prop1[0].Name  = "Jupp";
        prop1[0].Value = "GoodGuy";

        PropertyValue[] prop2 = new PropertyValue[1];
        prop2[0] = new PropertyValue();
        prop2[0].Name  = "Horst";
        prop2[0].Value = "BadGuy";

        try {
            Type t = xCont.getElementType();
View Full Code Here

        if (oldValue.equals(BT6)) newValue = BT6;
        if (oldValue.equals(BT6)) newValue = BT7;
        if (oldValue.equals(BT7)) newValue = BT1;
   } else
    if (oldValue instanceof PropertyValue){
        PropertyValue newVal = new PropertyValue();
        newVal.Name = ((PropertyValue)oldValue).Name;
        newVal.Value = changePValue(((PropertyValue)oldValue).Value);
        newValue = newVal;
    } else  
   if (oldValue instanceof com.sun.star.sheet.ValidationAlertStyle){
        com.sun.star.sheet.ValidationAlertStyle VAS1 = com.sun.star.sheet.ValidationAlertStyle.INFO;
        com.sun.star.sheet.ValidationAlertStyle VAS2 = com.sun.star.sheet.ValidationAlertStyle.MACRO;
        com.sun.star.sheet.ValidationAlertStyle VAS3 = com.sun.star.sheet.ValidationAlertStyle.STOP;
        com.sun.star.sheet.ValidationAlertStyle VAS4 = com.sun.star.sheet.ValidationAlertStyle.WARNING;

        if (oldValue.equals(VAS1)) newValue = VAS2;
        if (oldValue.equals(VAS2)) newValue = VAS3;
        if (oldValue.equals(VAS3)) newValue = VAS4;
        if (oldValue.equals(VAS4)) newValue = VAS1;

   } else
    if (oldValue instanceof com.sun.star.sheet.ValidationType){
        com.sun.star.sheet.ValidationType VT1 = com.sun.star.sheet.ValidationType.ANY;
        com.sun.star.sheet.ValidationType VT2 = com.sun.star.sheet.ValidationType.CUSTOM;
        com.sun.star.sheet.ValidationType VT3 = com.sun.star.sheet.ValidationType.DATE;
        com.sun.star.sheet.ValidationType VT4 = com.sun.star.sheet.ValidationType.DECIMAL;
        com.sun.star.sheet.ValidationType VT5 = com.sun.star.sheet.ValidationType.LIST;
        com.sun.star.sheet.ValidationType VT6 = com.sun.star.sheet.ValidationType.TEXT_LEN;
        com.sun.star.sheet.ValidationType VT7 = com.sun.star.sheet.ValidationType.TIME;
        com.sun.star.sheet.ValidationType VT8 = com.sun.star.sheet.ValidationType.WHOLE;

        if (oldValue.equals(VT1)) newValue = VT2;
        if (oldValue.equals(VT2)) newValue = VT3;
        if (oldValue.equals(VT3)) newValue = VT4;
        if (oldValue.equals(VT4)) newValue = VT5;
        if (oldValue.equals(VT5)) newValue = VT6;
        if (oldValue.equals(VT6)) newValue = VT7;
        if (oldValue.equals(VT7)) newValue = VT8;
        if (oldValue.equals(VT8)) newValue = VT1;

    } else
    if (oldValue instanceof com.sun.star.text.WritingMode){
        if (oldValue.equals(com.sun.star.text.WritingMode.LR_TB)) {
            newValue = com.sun.star.text.WritingMode.TB_RL;
        } else {
            newValue = com.sun.star.text.WritingMode.LR_TB;
        }
    } else
    if (oldValue instanceof com.sun.star.uno.Enum) {
        // universal changer for Enumerations
        try {
            Class enumClass = oldValue.getClass() ;
            Field[] flds = enumClass.getFields() ;

            newValue = null ;

            for (int i = 0; i < flds.length; i++) {
                if (Enum.class.equals(flds[i].getType().getSuperclass())) {

                    Enum value = (Enum) flds[i].get(null) ;
                    if (newValue == null && !value.equals(oldValue)) {
                        newValue = value ;
                        break ;
                    }
                }
            }
        } catch (Exception e) {
            System.err.println("Exception occured while changing Enumeration value:") ;
            e.printStackTrace(System.err) ;
        }
        if (newValue == null) newValue = oldValue ;

    } else
    if (oldValue instanceof com.sun.star.style.TabStop[]){
        com.sun.star.style.TabStop[] _newValue = (com.sun.star.style.TabStop[]) oldValue;
        if (_newValue.length == 0) {
            _newValue = new com.sun.star.style.TabStop[1];
        }
        com.sun.star.style.TabStop sep = new com.sun.star.style.TabStop();
        sep.Position += 1;
        _newValue[0] = sep;
        newValue = _newValue;
    } else
    if (oldValue instanceof short[]){
        short[] oldArr = (short[])oldValue;
        int len = oldArr.length;
        short[] newArr = new short[len + 1];
        for (int i = 0; i < len; i++) {
            newArr[i] = (short)(oldArr[i] + 1);
        }
        newArr[len] = 5;
        newValue = newArr;
    } else
    if (oldValue instanceof String[]){
        String[] oldArr = (String[])oldValue;
        int len = oldArr.length;
        String[] newArr = new String[len + 1];
        for (int i = 0; i < len; i++) {
            newArr[i] = "_" + oldArr[i];
        }
        newArr[len] = "_dummy";
        newValue = newArr;
    } else
    if (oldValue instanceof PropertyValue){
        PropertyValue newVal = new PropertyValue();
        newVal.Name = ((PropertyValue)oldValue).Name;
        newVal.Value = changePValue(((PropertyValue)oldValue).Value);
        newValue = newVal;
    } else
    if (oldValue instanceof com.sun.star.util.DateTime) {
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.