Examples of XServiceInfo


Examples of com.sun.star.lang.XServiceInfo

            configManagerName = (String)tEnv.getObjRelation("XModuleUIConfigurationManagerSupplier.ConfigurationManager");
            implementationName = (String)tEnv.getObjRelation("XModuleUIConfigurationManagerSupplier.ConfigManagerImplementationName");
           
            // get a config manager for the StartModule
            Object o = oObj.getUIConfigurationManager(configManagerName);
            XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, o);
            String impName = xServiceInfo.getImplementationName();
            boolean result = impName.equals(implementationName);
            if (!result) {
                log.println("Returned implementation was '" + impName +
                    "' but should have been '" + implementationName + "'");
            }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

    }}



    public boolean hasControlByName(String _FormName, Object _oDrawPageElement){
        XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, _oDrawPageElement);
        if (xServiceInfo.supportsService("com.sun.star.drawing.ControlShape")){
            XControlShape xControlShape = (XControlShape) UnoRuntime.queryInterface(XControlShape.class, _oDrawPageElement);
            XControlModel xControlModel = xControlShape.getControl();
            xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, xControlShape.getControl());
            if (xServiceInfo.supportsService("com.sun.star.form.FormComponent")){
                XChild xChild = (XChild) UnoRuntime.queryInterface(XChild.class, xControlModel);
                XNamed xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, xChild.getParent());
                String sName = xNamed.getName();
                return _FormName.equals(xNamed.getName());
            }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

        //XInterface xInterface = null;
        try {
            xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, xInterface);
            com.sun.star.lang.XComponent xComponent = xComponentLoader.loadComponentFromURL(sURL, sFrame, 0, xValues);

            XServiceInfo xComponentService = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, xComponent);
            if (xComponentService.supportsService("com.sun.star.text.TextDocument"))
                oDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent);

            //TODO: write if clauses for Calc, Impress and Draw

        } catch (Exception exception) {
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

// nicht das Model, sondern gleich den FixedText nehmen??
               
//                XMultiServiceFactory xMSF = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, xFixedTextModel);

                Object aFixedText = _xMSF.createInstance("com.sun.star.awt.UnoControlFixedText");
                XServiceInfo xServiceInfo2 = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, aFixedText);
                String[] sServices2 = xServiceInfo2.getSupportedServiceNames();
               
                XWindow xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, aFixedText);
                xWindow.setVisible(true);

                XFixedText xFixedText = (XFixedText)UnoRuntime.queryInterface(XFixedText.class, aFixedText);
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

            // check the result
            log.println("Result: "+ result.getClass().toString());
            XDynamicResultSet xDynamicResultSet = (XDynamicResultSet)UnoRuntime.queryInterface(XDynamicResultSet.class, result);
           
            // check bug of wrong returned service name.
            XServiceInfo xServiceInfo = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, xDynamicResultSet);
            String[] sNames = xServiceInfo.getSupportedServiceNames();
            String serviceName = sNames[0];
            if (sNames.length > 1)
                failed("Implementation has been changed. Check this test!");
            assure("The service name '" + serviceName + "' is not valid.", !serviceName.equals("com.sun.star.ucb.DynamicContentResultSet"), true);
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

        throws com.sun.star.uno.RuntimeException
    {
            if (object == null)
              throw new com.sun.star.uno.RuntimeException("The parameter must not been null");
           
            XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object);
           
            if (xServiceInfo != null) {
                return UnoRuntime.areSame(factoriesByImplNames.get(xServiceInfo.getImplementationName()), object);
            }  
       
    return false;
  }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

               com.sun.star.container.ElementExistException,
               com.sun.star.uno.RuntimeException
    {
        if (object == null) throw new com.sun.star.lang.IllegalArgumentException();
       
        XServiceInfo xServiceInfo =
                (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object);
       
        if (xServiceInfo == null)
            throw new com.sun.star.lang.IllegalArgumentException(
                "The given object does not implement the XServiceInfo interface."
            );
           
        if ( factoriesByImplNames.containsKey( xServiceInfo.getImplementationName() ) ) {
            throw new com.sun.star.container.ElementExistException(
                xServiceInfo.getImplementationName() + " already registred"
            );
        }
       
        DEBUG("add factory " + object.toString() + " for " + xServiceInfo.getImplementationName());
        factoriesByImplNames.put( xServiceInfo.getImplementationName(), object );
       
           
        String[] serviceNames = xServiceInfo.getSupportedServiceNames();
        java.util.Vector vec = null;
           
        for (int i=0; i<serviceNames.length; i++) {               
            if ( !factoriesByServiceNames.containsKey( serviceNames[i] ) ) {
              DEBUG("> no registered services found under " + serviceNames[i] + ": adding..." );
                factoriesByServiceNames.put(serviceNames[i], new java.util.Vector());
            }
               
            vec = (java.util.Vector) factoriesByServiceNames.get( serviceNames[i] );                                                 
           
            if ( vec.contains( object ) )
                System.err.println("The implementation " + xServiceInfo.getImplementationName() +
                    " already registered for the service " + serviceNames[i] + " - ignoring!");
            else               
                vec.addElement(object);
        }       
  }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

        if (object == null)
            throw new com.sun.star.lang.IllegalArgumentException(
                    "The given object must not be null."
            );
       
        XServiceInfo xServiceInfo =
            (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object);
       
        if (xServiceInfo == null)
            throw new com.sun.star.lang.IllegalArgumentException(
                    "The given object does not implement the XServiceInfo interface."
            );
       
        XSingleServiceFactory xSingleServiceFactory =
            (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, object);
       
        if (xSingleServiceFactory == null)
            throw new com.sun.star.lang.IllegalArgumentException(
                    "The given object does not implement the XSingleServiceFactory interface."
            );
       
        if ( factoriesByImplNames.remove( xServiceInfo.getImplementationName() ) == null )
            throw new com.sun.star.container.NoSuchElementException(
                    xServiceInfo.getImplementationName() +
                    " is not registered as an implementation."
            );
       
        String[] serviceNames = xServiceInfo.getSupportedServiceNames();
       
        for ( int i=0; i<serviceNames.length; i++ ) {
            if ( factoriesByServiceNames.containsKey( serviceNames[i] ) ) {
                java.util.Vector vec = (java.util.Vector) factoriesByServiceNames.get(serviceNames[i]);
               
                if ( !vec.removeElement(object) )
                    System.err.println("The implementation " + xServiceInfo.getImplementationName() +
                        " is not registered for the service " + serviceNames[i] + " - ignoring!");
               
                if ( vec.isEmpty() ) // remove the vector if no implementations aviable for the service
                    factoriesByServiceNames.remove( serviceNames[i] );  
            }                   
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

        return properties;
    }

    public void inspect(Object _component) throws com.sun.star.lang.NullPointerException
    {
        XServiceInfo serviceInfo = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, _component );
        if ( serviceInfo != null )
            m_supportedServices = serviceInfo.getSupportedServiceNames();
    }
View Full Code Here

Examples of com.sun.star.lang.XServiceInfo

    /**
     * Overrides super.before() to check the service is supported by the object.
     */
    protected void before() {
        XServiceInfo xInfo = (XServiceInfo)UnoRuntime.queryInterface(
                XServiceInfo.class, oObj);
       
        optionalService = entry.isOptional;

        String theService = getTestedClassName();
        if (xInfo != null && !xInfo.supportsService(theService)) {
            log.println("Service "+theService+" not available");
            if (optionalService) {
                log.println("This is OK since it is optional");
            } else {
                Status.failed(theService + " is not supported");
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.