Examples of XIntrospectionAccess


Examples of com.sun.star.beans.XIntrospectionAccess

    * has a base <code>XInterface</code> method
    * <code>acquire</code>.
    */
    public void _inspect() {
       boolean result = true;
       XIntrospectionAccess xIA = oObj.inspect(oObj);
       result = (xIA.hasMethod("acquire",1));
       tRes.tested("inspect()",result);
    }
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

   
   
    public boolean isContainer(Object _oUnoObject){
    boolean bIsContainer = false;
    try {
        XIntrospectionAccess xIntrospectionAccessObject = getXIntrospectionAccess(_oUnoObject);
        if (xIntrospectionAccessObject != null){
            XEnumerationAccess xEnumerationAccess = (XEnumerationAccess) UnoRuntime.queryInterface(XEnumerationAccess.class, xIntrospectionAccessObject.queryAdapter( new Type( XEnumerationAccess.class ) ) );
            if (xEnumerationAccess != null){
                XEnumeration xEnumeration = xEnumerationAccess.createEnumeration();
                bIsContainer = xEnumeration.hasMoreElements();
            }
            if (!bIsContainer){
                XIndexAccess xIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( XIndexAccess.class, xIntrospectionAccessObject.queryAdapter(new Type( XIndexAccess.class )));
                if (xIndexAccess != null){
                    bIsContainer = (xIndexAccess.getCount() > 0);
                }
            }
        }
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

    //  parent
    public Object[] getUnoObjectsOfContainer(Object _oUnoParentObject) {
    Object[] oRetComponents = null;
    try {
        Vector oRetComponentsVector = new Vector();
        XIntrospectionAccess xIntrospectionAccessObject = getXIntrospectionAccess(_oUnoParentObject);
        if ( xIntrospectionAccessObject != null ) {
            XEnumerationAccess xEnumerationAccess = (XEnumerationAccess) UnoRuntime.queryInterface(XEnumerationAccess.class, xIntrospectionAccessObject.queryAdapter( new Type( XEnumerationAccess.class ) ) );
            if ( xEnumerationAccess != null ) {
                XEnumeration xEnumeration = xEnumerationAccess.createEnumeration();
                while ( xEnumeration.hasMoreElements() ) {
                    oRetComponentsVector.add(xEnumeration.nextElement());
                }
            }
            XIndexAccess xIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( XIndexAccess.class, xIntrospectionAccessObject.queryAdapter(new Type( XIndexAccess.class )));
            if ( xIndexAccess != null ) {
                XIdlMethod mMethod = xIntrospectionAccessObject.getMethod("getByIndex", com.sun.star.beans.MethodConcept.INDEXCONTAINER);
                for ( int i = 0; i < xIndexAccess.getCount(); i++ ) {
                    Object[][] aParamInfo = new Object[1][1];
                    aParamInfo[0] = new Integer[] { new Integer(i) };
                    oRetComponentsVector.add(mMethod.invoke(_oUnoParentObject, aParamInfo));
                }
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

   
   
    //  add all methods for the given object to the tree under the node parent
    public XIdlMethod[] getMethods(Object _oUnoParentObject) {
    try {
        XIntrospectionAccess xIntrospectionAccess = getXIntrospectionAccess(_oUnoParentObject);
        if (xIntrospectionAccess != null){
            XIdlMethod[] xIdlMethods = xIntrospectionAccess.getMethods(MethodConcept.ALL - MethodConcept.DANGEROUS);
            return xIdlMethods;
        }
    }
    catch( Exception e ) {
        System.err.println( e );
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

    }
   
   
    protected Property[] getProperties( Object _oUnoParentObject){
    try {
        XIntrospectionAccess xIntrospectionAccess = getXIntrospectionAccess(_oUnoParentObject);
        if (xIntrospectionAccess != null){
            Property[] aProperties = xIntrospectionAccess.getProperties(com.sun.star.beans.PropertyConcept.ATTRIBUTES + com.sun.star.beans.PropertyConcept.PROPERTYSET);               
            return aProperties;
        }
    }
    catch( Exception e ) {
        System.err.println( e );
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

    private void addPropertiesToTreeNode(XUnoNode _oParentNode, Object _oUnoParentObject,  Property[] _aProperties) {
    try {
        if (_aProperties.length > 0){
            for ( int n = 0; n < _aProperties.length; n++ ){
                Property aProperty = _aProperties[n];
                XIntrospectionAccess xIntrospectionAccess = m_oIntrospector.getXIntrospectionAccess(_oUnoParentObject);
                XPropertySet xPropertySet = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, xIntrospectionAccess.queryAdapter(new Type( XPropertySet.class)));
                if (xPropertySet != null) {
                    if (xPropertySet.getPropertySetInfo().hasPropertyByName(aProperty.Name)){
                        Object objectElement = xPropertySet.getPropertyValue(aProperty.Name);
                        if (objectElement != null) {
                            XUnoNode oChildNode = m_xTreeControlProvider.addUnoPropertyNode(_oUnoParentObject, aProperty, objectElement);
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

                                    int intBegin = stringNode.indexOf( " " ) + 1;
                                    int intEnd = stringNode.indexOf( " (" );
                                    String stringMethod = stringNode.substring( intBegin, intEnd );
                                   
                                    Object objectGrandParent = hashtableObjects.get( treePath.getParentPath().getParentPath().toString() );
                                    XIntrospectionAccess xIntrospectionAccess = xIntrospection.inspect( objectGrandParent );
                                    XIdlMethod xIdlMethod = xIntrospectionAccess.getMethod( stringMethod, com.sun.star.beans.MethodConcept.ALL );
                                    String stringDeclaringClass = xIdlMethod.getDeclaringClass().getName().replace( '.', '/' );
                                   
                                    stringURLDocument = stringDeclaringClass + ".html#" + stringMethod;
                                }
                                else if ( ( stringParentNode.equals( "Services" )
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

        private void addMethodsToTree( Object a,
        DefaultMutableTreeNode parent,
        XIntrospection xIntrospection ) {
            try {
                //  get the introspection access for the given object
                XIntrospectionAccess xIntrospectionAccess = xIntrospection.inspect( a );
               
                //  get all the methods
                XIdlMethod[] mMethods = xIntrospectionAccess.getMethods( com.sun.star.beans.MethodConcept.ALL );
               
                for ( int n = 0; n < mMethods.length; n++ ) {
                    ParamInfo[] paramInfo = mMethods[ n ].getParameterInfos();
                    String stringParameters = "";
                    if ( paramInfo != null ) {
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

        private void addContainerToTree( Object a,
        DefaultMutableTreeNode parent,
        XIntrospection xIntrospection ) {
            try {
                //  get the introspection access for the given object
                XIntrospectionAccess xIntrospectionAccessObject = xIntrospection.inspect( a );
               
                if ( xIntrospectionAccessObject != null ) {
                   
                    //  get the enumeration access
                    XEnumerationAccess xEnumerationAccess = ( XEnumerationAccess ) UnoRuntime.queryInterface( XEnumerationAccess.class, xIntrospectionAccessObject.queryAdapter( new Type( XEnumerationAccess.class ) ) );
                    if ( xEnumerationAccess != null ) {
                        //  get the enumeration
                        XEnumeration xEnumeration = xEnumerationAccess.createEnumeration();
                       
                        //  create a node for the enumeration category
                        DefaultMutableTreeNode childEnumeration = new DefaultMutableTreeNode( "Enumeration" );
                       
                        while ( xEnumeration.hasMoreElements() ) {
                            //  the enumeration has more objects
                           
                            //  get the next object from the enumeration
                            Object objectElement = xEnumeration.nextElement();
                           
                            //  create a node for the object and add it to enumeration category
                            DefaultMutableTreeNode childEnumerationElement = new DefaultMutableTreeNode( objectElement.toString() );
                            childEnumeration.add( childEnumerationElement );
                        }
                       
                        if ( childEnumeration.getChildCount() > 0 ) {
                            //  there are some objects so that the enumeration root could be added to the tree
                            parent.add( childEnumeration );
                        }
                    }
                   
                    //  get the index access
                    XIndexAccess xIndexAccess = ( XIndexAccess ) UnoRuntime.queryInterface( XIndexAccess.class, xIntrospectionAccessObject.queryAdapter( new Type( XIndexAccess.class ) ) );
                    if ( xIndexAccess != null ) {
                       
                        //  create a node for the index category
                        DefaultMutableTreeNode childIndex = new DefaultMutableTreeNode( "Index" );
                       
View Full Code Here

Examples of com.sun.star.beans.XIntrospectionAccess

        DefaultMutableTreeNode parentContent,
        XIntrospection xIntrospection,
        TreePath treePath ) {
            try {
                //  get the introspection access for the given object
                XIntrospectionAccess xIntrospectionAccess = xIntrospection.inspect( a );
               
                //  get all properties for the given object
                Property[] myProperties = xIntrospectionAccess.getProperties( com.sun.star.beans.PropertyConcept.ALL );
               
                for ( int n = 0; n < myProperties.length; n++ ) {
                    //  get the type of class
                    Type type = myProperties[ n ].Type;
                    TypeClass typeClass = type.getTypeClass();
                   
                    //  get the property set with help of the introspection access
                    XPropertySet xPropertySet = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, xIntrospectionAccess.queryAdapter( new Type( XPropertySet.class ) ) );
                   
                    if ( xPropertySet != null ) {
                        //  get the value of the property
                        Object object = xPropertySet.getPropertyValue( myProperties[ n ].Name );
                       
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.