Examples of XServiceInfo


Examples of com.sun.star.lang.XServiceInfo

    /**
     * Print the supported services of a UNO object. 
     * @param aObject A UNO object.
     */
    public static void getSuppServices (Object aObject) {
        XServiceInfo xSI = (XServiceInfo)
                UnoRuntime.queryInterface(XServiceInfo.class,aObject);
        printArray(xSI.getSupportedServiceNames());
        String str="Therein not Supported Service";
    boolean notSupportedServices = false;
        for (int i=0;i<xSI.getSupportedServiceNames().length;i++) {
            if (! xSI.supportsService(xSI.getSupportedServiceNames()[i])) {
        notSupportedServices = true;
                str+="\n" + xSI.getSupportedServiceNames()[i];
            }
        }
    if (notSupportedServices)
      System.out.println(str);
    }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

            }
            catch(com.sun.star.lang.IndexOutOfBoundsException e) {
                System.out.println("* Cannot get item Nr: " + i);
                continue;
            }
            XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
                                        XServiceInfo.class,object);
            String[] services = xSI.getSupportedServiceNames();
            log.println("* Implementation Name: " + xSI.getImplementationName());
            String accName = object.getAccessibleContext().getAccessibleName();
            log.println("* Accessible Name: " + accName);
            for (int j=0; i<services.length; i++)
                log.println("* ServiceName "+i+": "+ services[j]);
            log.println("*****");
 
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

        }

    private String getFormatExtension(Object _xComponent /* int _nType*/ )
         {
             String sExtension;
             XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface( XServiceInfo.class, _xComponent );
             if ( xServiceInfo.supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
             {
                 // calc
                 sExtension = ".ods";
             }
             else if (xServiceInfo.supportsService("com.sun.star.text.TextDocument"))
             {
                 //writer
                 sExtension = ".odt";
             }
             else
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

        return resultURL;
    }


    private static String getXMLOutputFilterforXComponent(XComponent xComponent, StringBuffer suffix){
        XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, xComponent);
        if (xSI.supportsService("com.sun.star.text.TextDocument")){
            resetBuffer(suffix, ".sxw");
            return "swriter: StarOffice XML (Writer)";
        }else if (xSI.supportsService("com.sun.star.sheet.SpreadsheetDocument")){
            resetBuffer(suffix, ".sxc");
            return "scalc: StarOffice XML (Calc)";
        }else if (xSI.supportsService("com.sun.star.presentation.PresentationDocument")){
            resetBuffer(suffix, ".sxi");
            return "simpress: StarOffice XML (Impress)";
        }else if(xSI.supportsService("com.sun.star.drawing.DrawingDocument")){
            resetBuffer(suffix, ".sxd");
            return "sdraw: StarOffice XML (Draw)";
        }else if (xSI.supportsService("com.sun.star.formula.FormulaProperties")){
            resetBuffer(suffix, ".sxm");
            return "smath: StarOffice XML (Math)";
        }
        return null;
    }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

        {   
            String sName = "";
           
            if (m_xPropertySet != null)
            {
                XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, m_xPropertySet);
            if (xServiceInfo != null)
            {
                sName = xServiceInfo.getImplementationName();
            }
                XPropertySetInfo xInfo = m_xPropertySet.getPropertySetInfo();
                Property[] aAllProperties = xInfo.getProperties();
                DebugHelper.writeInfo("Show all properties of Implementation of :'" + sName + "'");
                for (int i = 0; i<aAllProperties.length; i++)
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

    public void updateDocInfoFields() {
        try {
            XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();
            while (xEnum.hasMoreElements()) {
                Object oTextField = xEnum.nextElement();           
                XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
               
                if (xSI.supportsService("com.sun.star.text.TextField.ExtendedUser")) {                 
                    XUpdatable xUp = (XUpdatable) UnoRuntime.queryInterface(XUpdatable.class, oTextField);
                    xUp.update();                      
                }
                if (xSI.supportsService("com.sun.star.text.TextField.User")) {                 
                    XUpdatable xUp = (XUpdatable) UnoRuntime.queryInterface(XUpdatable.class, oTextField);
                    xUp.update();                      
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

            dt.Month = (short) cal.get(Calendar.MONTH);
            dt.Month++;
           
            while (xEnum.hasMoreElements()) {
                Object oTextField = xEnum.nextElement();           
                XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
               
                if (xSI.supportsService("com.sun.star.text.TextField.DateTime")) {
                    XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTextField);
                    xPSet.setPropertyValue("IsFixed", Boolean.FALSE);
                    xPSet.setPropertyValue("DateTimeValue", dt);
                }
            }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

    public void fixDateFields(boolean _bSetFixed) {
    try {
        XEnumeration xEnum = xTextFieldsSupplier.getTextFields().createEnumeration();           
        while (xEnum.hasMoreElements()) {
            Object oTextField = xEnum.nextElement();           
            XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
            if (xSI.supportsService("com.sun.star.text.TextField.DateTime")) {
                XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTextField);
                xPSet.setPropertyValue("IsFixed", new Boolean(_bSetFixed));
            }
        }
    } catch (Exception e) {
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

     * <li>smath</li>
     * </ul>
     * or <CODE>null</CODE>
     */
    public static String getDocumentType(XComponent xComponent) {
        XServiceInfo sInfo = (XServiceInfo)UnoRuntime.queryInterface(
                XServiceInfo.class, xComponent);

        if (sInfo == null) {
            return "";
        } else if (sInfo.supportsService("com.sun.star.sheet.SpreadsheetDocument")) {
        return "scalc";
        } else if (sInfo.supportsService("com.sun.star.text.TextDocument")) {
        return "swriter";
        } else if (sInfo.supportsService("com.sun.star.drawing.DrawingDocument")) {
        return "sdraw";
        } else if (sInfo.supportsService("com.sun.star.presentation.PresentationDocument")) {
        return "simpress";
        } else if (sInfo.supportsService("com.sun.star.formula.FormulaProperties")) {
        return "smath";
        } else {
            return null;
        }
    }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

    }

    /* ------------------------------------------------------------------ */
    public String getImplementationName()
    {
        XServiceInfo si = (XServiceInfo)UnoRuntime.queryInterface(
            XServiceInfo.class, m_component );
        if ( si != null )
            return si.getImplementationName();
        return "";
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.