Examples of XServiceInfo


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

    // query for XServiceInfo
    public Object queryXServiceInfo( Object oObj )
    {
        if ( oObj != null ) {
            XServiceInfo oInfo = (XServiceInfo) UnoRuntime.queryInterface(
                                                      XServiceInfo.class, oObj);
            System.out.println ("!!!! XServiceInfo n.a. !!!! ");
        }
        else {
            System.out.println ("Object is empty!!!! ");
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

            return aDoc;
        }
   
    static boolean exportToPDF(XComponent _xComponent, String _sDestinationName)
        {
            XServiceInfo xServiceInfo =
                (XServiceInfo) UnoRuntime.queryInterface(
                    XServiceInfo.class, _xComponent
                    );
           
            ArrayList aPropertyList = new ArrayList();
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

                    //     nProperties ++;
                    // }
                    // int nPropsCount = 0;
                   
                    // If we are a SpreadSheet (calc), we need to set PrintAllSheets property to 'true'
                    XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface( XServiceInfo.class, _aDoc );
                    if ( xServiceInfo.supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
                    {
                        XMultiServiceFactory xMSF = _aGTA.getMultiServiceFactory();
                        Object aSettings = xMSF.createInstance( "com.sun.star.sheet.GlobalSheetSettings" );
                        if (aSettings != null)
                        {
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

                return;
            }
//  TODO: Do we need to wait?
            TimeHelper.waitInSeconds(1, "wait after loadFromURL.");

            XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface( XServiceInfo.class, aDoc );
            // String sFilter = getFilterName_forExcel(xServiceInfo);
            // System.out.println("Filter is " + sFilter);

            // store the document in an other directory
            XStorable xStorable = (XStorable) UnoRuntime.queryInterface( XStorable.class, aDoc);
            if (xStorable == null)
            {
                GlobalLogWriter.get().println("com.sun.star.frame.XStorable is null");
                return;
            }
               
            String sFilterName = _aGTA.getExportFilterName();

            // check how many Properties should initialize
            int nPropertyCount = 0;
            // if (sFilterName != null && sFilterName.length() > 0)
            // {
            //     nPropertyCount ++;
            // }
           
            // initialize PropertyArray
            // PropertyValue [] aStoreProps = new PropertyValue[ nPropertyCount ];
            // int nPropertyIndex = 0;
            ArrayList aPropertyList = new ArrayList();
           
            String sExtension = "";

            if (sFilterName != null && sFilterName.length() > 0)
            {
                String sInternalFilterName = getInternalFilterName(sFilterName, xMSF);
                String sServiceName = getServiceNameFromFilterName(sFilterName, xMSF);
                   
                GlobalLogWriter.get().println("Filter detection:");
                // check if service name from file filter is the same as from the loaded document
                boolean bServiceFailed = false;
                if (sServiceName == null || sInternalFilterName == null)
                {
                    GlobalLogWriter.get().println("Given FilterName '" + sFilterName + "' seems to be unknown.");
                    bServiceFailed = true;
                }
                if (! xServiceInfo.supportsService(sServiceName))
                {
                    GlobalLogWriter.get().println("Service from FilterName '" + sServiceName + "' is not supported by loaded document.");
                    bServiceFailed = true;
                }
                if (bServiceFailed == true)
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

     *
     */
    public static String getImplName(Object aObject) {
        String res = "Error getting Implementation name";
        try {
            XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, aObject);
            res = xSI.getImplementationName();
        } catch (Exception e) {
            res = "Error getting Implementation name ( " + e + " )";
        }

        return res;
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

        return !res;
    }   
   
    protected String getImplementationName(XInterface ifc) {
        String res = "";
        XServiceInfo info = (XServiceInfo)
                    UnoRuntime.queryInterface(XServiceInfo.class, ifc);
        if (info != null) {
            res = info.getImplementationName();
        }
        return res;
    }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

            return aDoc;
        }
   
    static boolean exportToPDF(XComponent _xComponent, String _sDestinationName)
        {
            XServiceInfo xServiceInfo =
                (XServiceInfo) UnoRuntime.queryInterface(
                    XServiceInfo.class, _xComponent
                    );
           
            ArrayList aPropertyList = new ArrayList();
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.