Package com.sun.star.lang

Examples of com.sun.star.lang.XServiceInfo


    /**
     * get a shortcut manager
     */
    public void _getShortCutManager() {
        Object o = oObj.getShortCutManager();
        XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class,o);
        String[] serviceNames = xSI.getSupportedServiceNames();
    boolean bSupportedServiceFound = false;
        for (int i=0; i<serviceNames.length; i++) {
            log.println("SuppService: " + serviceNames[i]);
            if (serviceNames[i].equals(sShortCutManagerServiceName)) {
                bSupportedServiceFound = true;
View Full Code Here


     * <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.formula.FormulaProperties")) {
        return "smath";
        } else {
            return null;
        }
    }
View Full Code Here

   
    public String getClassName(){
        String sClassName = "";
        if (m_oUnoObject != null){
            XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, m_oUnoObject);
            if (xServiceInfo != null){
                String[] sServiceNames = xServiceInfo.getSupportedServiceNames();
                for (int i = 0; i < sServiceNames.length; i++){
                    if (doesServiceSupportProperty(sServiceNames[i], m_sPropertyName)){
                        sClassName = sServiceNames[i];
                        break;
                    }
View Full Code Here

        tEnv.addObjRelation("Selections", new Object[] {
            oFrame1, oFrame2, textRanges1, textRanges2});
        tEnv.addObjRelation("Comparer", new Comparator() {
            public int compare(Object o1, Object o2) {
                XServiceInfo serv1 = (XServiceInfo)
                    UnoRuntime.queryInterface(XServiceInfo.class, o1);
                XServiceInfo serv2 = (XServiceInfo)
                    UnoRuntime.queryInterface(XServiceInfo.class, o2);

                String implName1 = serv1.getImplementationName();
                String implName2 = serv2.getImplementationName();
                if (!implName1.equals(implName2)) {
                    return -1;
                }

                XIndexAccess indAc1 = (XIndexAccess)
View Full Code Here

    }
   
       
    public boolean hasSupportedServices(Object _oUnoObject){
        boolean bHasSupportedServices = false;
        XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, _oUnoObject);
        if ( xServiceInfo != null ){
            String[] sSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
            bHasSupportedServices = sSupportedServiceNames.length > 0;
        }
        return bHasSupportedServices;
    }
View Full Code Here

       
               
        //  add all services for the given object to the tree under the node parent
        private void addServicesToTreeNode(XUnoNode _oGrandParentNode, Object _oUnoObject) {
        try{
            XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, _oUnoObject );               
            if ( xServiceInfo != null ){
                String[] sSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
                for ( int m = 0; m < sSupportedServiceNames.length; m++ ) {
                    String sServiceName = sSupportedServiceNames[m];
                    if (sServiceName.length() > 0){
                        XUnoNode oUnoNode = addUnoNode(_oGrandParentNode, _oUnoObject, sSupportedServiceNames[m]);
                        oUnoNode.setNodeType(XUnoNode.nSERVICE);
View Full Code Here

        return getNodeDescription(_oUnoObject) + "[" + (_nIndex + 1) + "]";
    }


    public static String getNodeDescription(Object _oUnoObject){
        XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, _oUnoObject );               
        if ( xServiceInfo != null ) {
            return xServiceInfo.getImplementationName();
        }
        String sClassName = _oUnoObject.getClass().getName();
        if (Introspector.getIntrospector().isObjectPrimitive(_oUnoObject)){         //super.isO{sObjectClassName.equals("java.lang.String"))issClassName.equals("java.lang.String"))
            return _oUnoObject.toString();
        }
View Full Code Here

                //  Get the interface XIntrospection from the MultiServiceFactory
                Object o = xmulticomponentfactory.createInstanceWithContext( "com.sun.star.beans.Introspection", xcomponentcontext );
                xIntrospection = ( XIntrospection ) UnoRuntime.queryInterface( XIntrospection.class, o );
               
                //  Get the interface XServiceInfo because of the implementation name
                XServiceInfo xServiceInfoRoot = ( XServiceInfo ) UnoRuntime.queryInterface(
                    XServiceInfo.class, a );
               
                //  Get the implementation name and the implemented class
                String stringTreeNodeName = xServiceInfoRoot.getImplementationName() + " = " + a.toString();
               
                //  set the root node of the object tree
                DefaultMutableTreeNode root;
                root = new DefaultMutableTreeNode( stringTreeNodeName );
               
View Full Code Here

        //  add all services for the given object to the tree under the node parent
        private void addServicesToTree(Object a,
        DefaultMutableTreeNode parent) {
            try {
                //  get the service info for the given object
                XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, a );
               
                if ( xServiceInfo != null ) {
                    //  get all supported services
                    String[] stringSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
                   
                    for ( int m = 0; m < stringSupportedServiceNames.length; m++ ) {
                        //  create a node for the service and add it to the tree
                        DefaultMutableTreeNode child = new DefaultMutableTreeNode( stringSupportedServiceNames[ m ] );
                        parent.add( child );
View Full Code Here

                            // are also part of this
                            // enumeration access, so we ask the element if it is a TextTable, if it
                            // doesn't support the
                            // com.sun.star.text.TextTable service, then it is safe to assume that it
                            // really is a paragraph
                            XServiceInfo xInfo = (XServiceInfo) UnoRuntime.queryInterface(
                                    XServiceInfo.class, xParaEnum.nextElement() );
                            if ( !xInfo.supportsService ( "com.sun.star.text.TextTable" ) )
                            {
                                    // Access the paragraph's property set...the properties in this
                                    // property set are listed
                                    // in: com.sun.star.style.ParagraphProperties
                                    XPropertySet xSet = (XPropertySet) UnoRuntime.queryInterface(
View Full Code Here

TOP

Related Classes of com.sun.star.lang.XServiceInfo

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.