Package com.sun.star.container

Examples of com.sun.star.container.XNameAccess


        boolean mandantoryFalse = false;
        boolean finalizedTrue = false;
        boolean finalizedFalse = false;
       
       
        XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
            (XNameAccess.class, oObj);
        String[] filterNames = xNA.getElementNames();

        // XNameContainer; XNameReplace
        String filterName = filterNames[0];
        Object[] instance = null;;
        for (int i = 0; i < filterNames.length; i++) {
            log.println("------------------------------------------------");
            try{
                PropertyValue instanceProp = new PropertyValue();
                filterName = filterNames[i];
                log.println(filterName);
               
                // testobject must new created for every test.
                // We change in a loop the container and try to flush this changes.
                // If we get an expected exception this container is corrupt. It's
                // similar to a document which could not be saved beacuse of invalid
                // contend. While you don't remove the invalid conted you will never
                // be able to save the document. Same here.
                try{
                    oObj = getTestObject(serviceName);
                } catch (java.lang.Exception e){
                    failed("could not get test object", CONTINUE);
                }
               
                xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oObj);
                XNameContainer xNC = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oObj);
                XNameReplace xNR = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class, oObj);
                XFlushable xFlush = (XFlushable) UnoRuntime.queryInterface(XFlushable.class, oObj);

                instance = (Object[]) xNA.getByName(filterName);
                PropertyValue[] props = (PropertyValue[]) instance;
               
                printPropertyValues(props);
               
                boolean isMandatory = ((Boolean) getPropertyValueValue(props, "Mandatory")).booleanValue();
View Full Code Here


                        }
                    }
                }
                else
                {
                    XNameAccess xNameAccess = (XNameAccess)
                    UnoRuntime.queryInterface(XNameAccess.class, xStorages[i-1]);
                    if (xNameAccess == null )
                    {
                        disposeObject();
                        throw new IOException("No name access " + name);
                    }
                    else if ( !xNameAccess.hasByName(name) || !xStorages[i-1].isStorageElement(name) )
                    {
                        if ( !create )
                        {
                            disposeObject();
                            throw new IOException("No subdir: " + name);
View Full Code Here

     * Get the elements of the root node.
     * @return All elements of the root node.
     */
    public String[] getRootNodeNames() {

        XNameAccess xName = (XNameAccess)
                    UnoRuntime.queryInterface(XNameAccess.class, root);       
        String[]names = xName.getElementNames();
        return names;
    }
View Full Code Here

    public String[] getSubNodeNames(String name) {
        String[]names = null;
        try {                                   

            Object next = root.getByHierarchicalName(name);
            XNameAccess x = (XNameAccess)UnoRuntime.queryInterface(
                                                XNameAccess.class, next);
            names = x.getElementNames();
            for (int i=0; i< names.length; i++) {
                names[i] = name + "/" + names[i];
            }
        }
        catch(Exception e) {
View Full Code Here

            {
                XInterface x = (XInterface)m_xXMultiServiceFactory.createInstance("com.sun.star.sdb.DatabaseContext");
                assure("can't create instance of com.sun.star.sdb.DatabaseContext", x != null);
                log.println("createInstance com.sun.star.sdb.DatabaseContext done");
               
                XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, x);
                showElements(xNameAccess);
                Object aObj = xNameAccess.getByName(sFileURL);
//                    log.println("1");
               
                    // PropertySetHelper aHelper = new PropertySetHelper(aObj);
                XDocumentDataSource xDataSource = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class, aObj);
//                    Object aDatabaseDocmuent = aHelper.getPropertyValueAsObject("DatabaseDocument");
View Full Code Here

    /**
    * Test calls the method and checks returned value. <p>
    * Has <b> OK </b> status if returned value isn't null. <p>
    */
    public void _getCustomPresentations() {
        XNameAccess NA = oObj.getCustomPresentations();
        tRes.tested("getCustomPresentations()", NA != null);
    }
View Full Code Here

            testURL = dirToUrl(docPath + "/" + "TestDB") ;
        testURL = "sdbc:dbase:" + testURL ;

        String existURL = null ;

        XNameAccess na = (XNameAccess) UnoRuntime.queryInterface
            (XNameAccess.class, dbContext) ;

        Object src = null ;
        if (na.hasByName("APITestDatabase")) {
            src = dbContext.getRegisteredObject("APITestDatabase") ;

            XPropertySet srcPs = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, src) ;
View Full Code Here

public class _XTextSectionsSupplier extends MultiMethodTest {
    public XTextSectionsSupplier oObj;

    public void _getTextSections() {
        XNameAccess sections = oObj.getTextSections();
        boolean res = checkSections(sections);
        tRes.tested("getTextSections()", res);
    }
View Full Code Here

   
   
    private void setStyles(){  
    try {
        Object oRootNode = Configuration.getConfigurationRoot(xMSF, "org.openoffice.Office.FormWizard/FormWizard/Styles", false);
        XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oRootNode);
        StyleNodeNames = xNameAccess.getElementNames();
        StyleNames = new String[StyleNodeNames.length];
        FileNames = new String[StyleNodeNames.length];
        for (int i = 0; i < StyleNodeNames.length; i++){
             Object oStyleNode = xNameAccess.getByName(StyleNodeNames[i]);
             StyleNames[i] (String) Helper.getUnoPropertyValue(oStyleNode, "Name");
             FileNames[i] (String) Helper.getUnoPropertyValue(oStyleNode, "CssHref");
        }
    } catch (Exception e) {
        e.printStackTrace(System.out);
View Full Code Here

        XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
            UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
        XSpreadsheets sheets = (XSpreadsheets) xSpreadsheetDoc.getSheets();

        XNameAccess oNames = (XNameAccess)
            UnoRuntime.queryInterface( XNameAccess.class, sheets );
        XCell oCell = null;
        XSpreadsheet oSheet  = null;
        try {
            oSheet = (XSpreadsheet) AnyConverter.toObject(
                    new Type(XSpreadsheet.class),
                        oNames.getByName(oNames.getElementNames()[0]));
            // adding an annotation...
            XCellRange oCRange = (XCellRange)
                UnoRuntime.queryInterface(XCellRange.class, oSheet);
            oCell = oCRange.getCellByPosition(10,10);
        } catch (com.sun.star.lang.WrappedTargetException e) {
View Full Code Here

TOP

Related Classes of com.sun.star.container.XNameAccess

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.