Package com.sun.star.lang

Examples of com.sun.star.lang.XTypeProvider


        try
        {
            maOut.println ("Interfaces:");
            // Use interface XTypeProvider to retrieve a list of supported
            // interfaces.
            XTypeProvider xTP = (XTypeProvider) UnoRuntime.queryInterface (
                XTypeProvider.class, xObject);
            if (xTP == null)
                maOut.println ("    interface XTypeProvider not supported");
            else
            {
                Type[] aTypeList = xTP.getTypes ();
                maOut.println ("    object supports " + aTypeList.length
                    + " interfaces");
                for (int i=0; i<aTypeList.length; i++)
                    maOut.println ("        " + i + " : "
                        + aTypeList[i].getTypeName());
View Full Code Here


                new DefaultMutableTreeNode("XServiceInfo not supported"));
    }

    private void CreateInterfaceTree ()
    {
        XTypeProvider xTypeProvider = (XTypeProvider)UnoRuntime.queryInterface(
            XTypeProvider.class, mxContext);
        maInterfaceRoot.removeAllChildren();
        if (xTypeProvider != null)
        {
            Type[] aTypes = xTypeProvider.getTypes();
            int nCount = aTypes.length;
            for (int i=0; i<nCount; i++)
                maInterfaceRoot.add (
                    new DefaultMutableTreeNode (aTypes[i].getTypeName()));
        }
View Full Code Here

        try
        {
            maOut.println ("Interfaces:");
            // Use interface XTypeProvider to retrieve a list of supported
            // interfaces.
            XTypeProvider xTP = (XTypeProvider) UnoRuntime.queryInterface (
                XTypeProvider.class, xObject);
            if (xTP == null)
                maOut.println ("    interface XTypeProvider not supported");
            else
            {
                Type[] aTypeList = xTP.getTypes ();
                maOut.println ("    object supports " + aTypeList.length
                    + " interfaces");
                for (int i=0; i<aTypeList.length; i++)
                    maOut.println ("        " + i + " : "
                        + aTypeList[i].getTypeName());
View Full Code Here

    }

   
    protected Type[] getInterfaces(Object _oUnoParentObject){
        Type[] aTypes = new Type[]{};
        XTypeProvider xTypeProvider = ( XTypeProvider ) UnoRuntime.queryInterface( XTypeProvider.class, _oUnoParentObject);
        if ( xTypeProvider != null ) {
            aTypes = xTypeProvider.getTypes();
        }
        return aTypes;
    }
View Full Code Here

        tRes.tested("createClone()", result) ;
    }
   
    protected byte[] getImplementationID(XInterface ifc) {
        byte[] res = new byte[0];
        XTypeProvider provider = (XTypeProvider)
                    UnoRuntime.queryInterface(XTypeProvider.class, ifc);
        if (provider != null) {
            res = provider.getImplementationId();
        }
        return res;
    }
View Full Code Here

        //  add all interfaces for the given object to the tree under the node parent
        private void addInterfacesToTree( Object a,
        DefaultMutableTreeNode parent ) {
            try {
                //  get the type provider for the given object
                XTypeProvider xTypeProvider = ( XTypeProvider ) UnoRuntime.queryInterface( XTypeProvider.class, a );
                if ( xTypeProvider != null ) {
                    //  get all interfaces
                    Type[] type = xTypeProvider.getTypes();
                   
                    for ( int m = 0; m < type.length; m++ ) {
                        //  create a node for the current interface and add it to the tree
                        DefaultMutableTreeNode child = new DefaultMutableTreeNode( type[ m ].getTypeName() );
                        //DefaultMutableTreeNode child = new DefaultMutableTreeNode( com.sun.star.lib.uno.typedesc.TypeDescription.getTypeDescription( type[ m ] ).getTypeName() );
View Full Code Here

    //we can test the objects
    public void test(Object o){
        if(o!=null){
            XServiceInfo xServiceInfo = null;
            XTypeProvider xTypeProvider = null;
            XPropertySet xPS = null;
            System.out.println("the test class: "+o.toString()+"----"+o.getClass()+"------------");
            System.out.println("----------------------ServiceTest----------------------");
            xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, o );
            if(xServiceInfo != null){
                String[] s = xServiceInfo.getSupportedServiceNames();
                for(int i=0;i<s.length;i++)
                System.out.println(s[i]);
            }
            System.out.println("----------------------InterfaceTest--------------------");
            xTypeProvider = ( XTypeProvider ) UnoRuntime.queryInterface( XTypeProvider.class, o );
            if(xServiceInfo != null){
                Type[] t = xTypeProvider.getTypes();
                for(int i=0;i<t.length;i++)
                    System.out.println(t[i].getTypeName());
            }
            System.out.println("-----------------------PropertyTest------------------------");
            xPS =  (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, o);
View Full Code Here

    // returns the names of all exported interfaces of a UNO object
    protected String[] getExportedInterfaceNames(){
        Type[] aTypes = new Type[]{};
        String[] sTypeNames = new String[]{};
        // The XTypeProvider interfaces offers access to all exported interfaces
        XTypeProvider xTypeProvider = ( XTypeProvider ) UnoRuntime.queryInterface( XTypeProvider.class, m_oUnoObject);
        if ( xTypeProvider != null ) {
            aTypes = xTypeProvider.getTypes();
            sTypeNames = new String[aTypes.length];
            for (int i = 0; i < aTypes.length - 1; i++){
                sTypeNames[i] = aTypes[i].getTypeName();
            }
        }
View Full Code Here

    // returns the names of all exported interfaces of a UNO object
    protected String[] getExportedInterfaceNames(){
        Type[] aTypes = new Type[]{};
        String[] sTypeNames = new String[]{};
        // The XTypeProvider interfaces offers access to all exported interfaces
        XTypeProvider xTypeProvider = ( XTypeProvider ) UnoRuntime.queryInterface( XTypeProvider.class, m_oUnoObject);
        if ( xTypeProvider != null ) {
            aTypes = xTypeProvider.getTypes();
            sTypeNames = new String[aTypes.length];
            for (int i = 0; i < aTypes.length - 1; i++){
                sTypeNames[i] = aTypes[i].getTypeName();
            }
        }
View Full Code Here

                XServiceInfo.class, ((AccTreeNode)aNode).getContext());
        return xServiceInfo;
    }
    private XTypeProvider GetTypeProvider (AccessibleTreeNode aNode)
    {
        XTypeProvider xTypeProvider = null;
        if (aNode instanceof AccTreeNode)
            xTypeProvider = (XTypeProvider)UnoRuntime.queryInterface(
                XTypeProvider.class, ((AccTreeNode)aNode).getContext());
        return xTypeProvider;
    }
View Full Code Here

TOP

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

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.