Package com.sun.star.uno

Examples of com.sun.star.uno.Type


    */
    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


        public Type[] getTypes() {
            Type[] typeReturn = {
            };

            try {
                typeReturn = new Type[] { new Type(com.sun.star.task.XJobExecutor.class)
                                        , new Type(com.sun.star.lang.XTypeProvider.class)
                                        , new Type(com.sun.star.lang.XServiceInfo.class)
                                        , new Type(com.sun.star.beans.XPropertySet.class)
                                        , new Type(com.sun.star.beans.XFastPropertySet.class)
                                        , new Type(com.sun.star.beans.XMultiPropertySet.class)
                                        , new Type(com.sun.star.lang.XInitialization.class)};
            } catch (Exception exception) {
                System.err.println(exception);
            }

            return (typeReturn);
View Full Code Here

        XSpreadsheets oSheets = xSheetDoc.getSheets() ;
        XIndexAccess oIndexSheets = (XIndexAccess)
            UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
        try {
            oSheet = (XSpreadsheet) AnyConverter.toObject(
                    new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
        } catch(com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get sheet", e);
        } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get sheet", e);
        } catch(com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get sheet", e);
        }

        log.println("Creating the Header") ;

        insertIntoCell(1,0,"JAN",oSheet,"");
        insertIntoCell(2,0,"FEB",oSheet,"");
        insertIntoCell(3,0,"MAR",oSheet,"");
        insertIntoCell(4,0,"APR",oSheet,"");
        insertIntoCell(5,0,"MAI",oSheet,"");
        insertIntoCell(6,0,"JUN",oSheet,"");
        insertIntoCell(7,0,"JUL",oSheet,"");
        insertIntoCell(8,0,"AUG",oSheet,"");
        insertIntoCell(9,0,"SEP",oSheet,"");
        insertIntoCell(10,0,"OCT",oSheet,"");
        insertIntoCell(11,0,"NOV",oSheet,"");
        insertIntoCell(12,0,"DEC",oSheet,"");
        insertIntoCell(13,0,"SUM",oSheet,"");

        log.println("Fill the lines");

        insertIntoCell(0,1,"Smith",oSheet,"");
        insertIntoCell(1,1,"42",oSheet,"V");
        insertIntoCell(2,1,"58.9",oSheet,"V");
        insertIntoCell(3,1,"-66.5",oSheet,"V");
        insertIntoCell(4,1,"43.4",oSheet,"V");
        insertIntoCell(5,1,"44.5",oSheet,"V");
        insertIntoCell(6,1,"45.3",oSheet,"V");
        insertIntoCell(7,1,"-67.3",oSheet,"V");
        insertIntoCell(8,1,"30.5",oSheet,"V");
        insertIntoCell(9,1,"23.2",oSheet,"V");
        insertIntoCell(10,1,"-97.3",oSheet,"V");
        insertIntoCell(11,1,"22.4",oSheet,"V");
        insertIntoCell(12,1,"23.5",oSheet,"V");
        insertIntoCell(13,1,"=SUM(B2:M2)",oSheet,"");

        insertIntoCell(0,2,"Jones",oSheet,"");
        insertIntoCell(1,2,"21",oSheet,"V");
        insertIntoCell(2,2,"40.9",oSheet,"V");
        insertIntoCell(3,2,"-57.5",oSheet,"V");
        insertIntoCell(4,2,"-23.4",oSheet,"V");
        insertIntoCell(5,2,"34.5",oSheet,"V");
        insertIntoCell(6,2,"59.3",oSheet,"V");
        insertIntoCell(7,2,"27.3",oSheet,"V");
        insertIntoCell(8,2,"-38.5",oSheet,"V");
        insertIntoCell(9,2,"43.2",oSheet,"V");
        insertIntoCell(10,2,"57.3",oSheet,"V");
        insertIntoCell(11,2,"25.4",oSheet,"V");
        insertIntoCell(12,2,"28.5",oSheet,"V");
        insertIntoCell(13,2,"=SUM(B3:M3)",oSheet,"");

        insertIntoCell(0,3,"Brown",oSheet,"");
        insertIntoCell(1,3,"31.45",oSheet,"V");
        insertIntoCell(2,3,"-20.9",oSheet,"V");
        insertIntoCell(3,3,"-117.5",oSheet,"V");
        insertIntoCell(4,3,"23.4",oSheet,"V");
        insertIntoCell(5,3,"-114.5",oSheet,"V");
        insertIntoCell(6,3,"115.3",oSheet,"V");
        insertIntoCell(7,3,"-171.3",oSheet,"V");
        insertIntoCell(8,3,"89.5",oSheet,"V");
        insertIntoCell(9,3,"41.2",oSheet,"V");
        insertIntoCell(10,3,"71.3",oSheet,"V");
        insertIntoCell(11,3,"25.4",oSheet,"V");
        insertIntoCell(12,3,"38.5",oSheet,"V");
        insertIntoCell(13,3,"=SUM(A4:L4)",oSheet,"");

        // insert a chart
        Rectangle oRect = new Rectangle(500, 3000, 25000, 11000);

        XCellRange oRange = (XCellRange)
            UnoRuntime.queryInterface(XCellRange.class, oSheet);
        XCellRange myRange = oRange.getCellRangeByName("A1:N4");
        XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
            UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
        CellRangeAddress myAddr = oRangeAddr.getRangeAddress();

        CellRangeAddress[] oAddr = new CellRangeAddress[1];
        oAddr[0] = myAddr;
        XTableChartsSupplier oSupp = (XTableChartsSupplier)
            UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet);

        log.println("Insert Chart");
        XTableCharts oCharts = oSupp.getCharts();


        if (!oCharts.hasByName("ChXDiagram")) {
            oCharts.addNewByName("ChXDiagram", oRect, oAddr, true, true);
        }

        // get the TableChart
        XTableChart oChart = null;
        try {
            oChart = (XTableChart) AnyConverter.toObject(
                new Type(XTableChart.class),((XNameAccess)
                    UnoRuntime.queryInterface(
                        XNameAccess.class, oCharts)).getByName("ChXDiagram"));
        } catch (com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get TableChart", e);
View Full Code Here

            public int compare(Object o1, Object o2) {
                XMutableTreeNode xNode1 = (XMutableTreeNode) UnoRuntime.queryInterface(
                                        XMutableTreeNode.class, o1);
                XTreeNode xNode2a = null;
                try {
                    xNode2a = (XTreeNode) AnyConverter.toObject(new Type(XTreeNode.class), o2);
                } catch (com.sun.star.lang.IllegalArgumentException ex) {
                    ex.printStackTrace();
                }
               
                XMutableTreeNode xNode2 = (XMutableTreeNode) UnoRuntime.queryInterface(
View Full Code Here

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

        try {
            Type t = xCont.getElementType();
            log.println("Insertable Type: " + t.getTypeName());
            assure("Initial container is not empty.", !xCont.hasElements());

            log.println("Insert a PropertyValue.");
            xCont.insertByName("prop1", prop1);
            PropertyValue[]ret = (PropertyValue[])xCont.getByName("prop1");
View Full Code Here

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

        try {
            Type t = xCont.getElementType();
            log.println("Insertable Type: " + t.getTypeName());
            assure("Initial container is not empty: " + xCont.getCount(), xCont.getCount()==0);
            log.println("Inserting a PropertyValue.");
            xCont.insertByIndex(0, prop1);
            PropertyValue[]ret = (PropertyValue[])xCont.getByIndex(0);
            assure("Got the wrong PropertyValue: " +
View Full Code Here

        public com.sun.star.uno.Type[] getTypes() {
            Type[] typeReturn = {};

            try {
                typeReturn = new Type[] {
                new Type( XTypeProvider.class ),
                new Type( XImportFilter.class ),
    new Type( XExportFilter.class ),
                new Type( XServiceName.class ),
                new Type( XServiceInfo.class ) };
            }
            catch( Exception exception ) {
   
            }
View Full Code Here

    //System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value;

     try{
         //System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
         if (pValue[i].Name.compareTo("InputStream")==0){
      xis=(com.sun.star.io.XInputStream)AnyConverter.toObject(new Type(com.sun.star.io.XInputStream.class), pValue[i].Value);
         }
         if (pValue[i].Name.compareTo("FileName")==0){
       sFileName=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
         }
       
     }
     catch(com.sun.star.lang.IllegalArgumentException AnyExec){
         System.out.println("\nIllegalArgumentException "+AnyExec);
View Full Code Here

   

    try{
        //System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
        if (pValue[i].Name.compareTo("OutputStream")==0){
      xos=(com.sun.star.io.XOutputStream)AnyConverter.toObject(new Type(com.sun.star.io.XOutputStream.class), pValue[i].Value);
      //  System.out.println(pValue[i].Name+" "+xos);
        }
        if (pValue[i].Name.compareTo("FileName")==0){
      sFileName=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
      //System.out.println(pValue[i].Name+" "+sFileName);
        }
        if (pValue[i].Name.compareTo("URL")==0){
      sURL=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
      // System.out.println("\nMediaDescriptor url "+pValue[i].Name+" "+sURL);
     
        }
        if (pValue[i].Name.compareTo("Title")==0){
      
      title=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
      //System.out.println(pValue[i].Name+" "+title);
        }
    }
    catch(com.sun.star.lang.IllegalArgumentException AnyExec){
         System.out.println("\nIllegalArgumentException "+AnyExec);
View Full Code Here

        // reading the values
        NamedValue nv = null;
        debug("The transformation's parameters as 'name = value' pairs:\n");

        for (int i = 0; i < values.length; i++) {
            nv = (NamedValue) AnyConverter.toObject(new Type(NamedValue.class), values[i]);

            if (nv.Name != null && !nv.Name.equals("")) {
                debug(nv.Name + " = " + nv.Value);
            }

            if (nv.Name.equals("StylesheetURL")) {
                stylesheeturl = (String) AnyConverter.toObject(
                        new Type(String.class), nv.Value);
            } else if (nv.Name.equals("SourceURL")) {
                sourceurl = (String) AnyConverter.toObject(
                        new Type(String.class), nv.Value);
            } else if (nv.Name.equals("TargetURL")) {
                targeturl = (String) AnyConverter.toObject(
                        new Type(String.class), nv.Value);
            } else if (nv.Name.equals("SourceBaseURL")) {
                sourcebaseurl = (String) AnyConverter.toObject(
                        new Type(String.class), nv.Value);
            } else if (nv.Name.equals("TargetBaseURL")) {
                targetbaseurl = (String) AnyConverter.toObject(
                        new Type(String.class), nv.Value);
            } else if (nv.Name.equals("SystemType")) {
                systype = (String) AnyConverter.toObject(
                        new Type(String.class), nv.Value);
            } else if (nv.Name.equals("PublicType")) {
                pubtype = (String) AnyConverter.toObject(
                        new Type(String.class), nv.Value);
            }
        }
    }
View Full Code Here

TOP

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

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.