Package com.sun.star.container

Examples of com.sun.star.container.XNameAccess


    * Has OK status if method returns not null
    * <code>XNameAccess</code> object, FAILED otherwise.
    */
    public void _getColumns() {

        XNameAccess cols = oObj.getColumns() ;

        /*
        String[] colNames = cols.getElementNames() ;

        log.println("Column names:") ;
View Full Code Here


    * <code>XNameAccess</code> object, FAILED otherwise.
    */
    public void _getTables() {
        boolean result = true ;

        XNameAccess tabs = oObj.getTables() ;

       
        String[] tabNames = tabs.getElementNames() ;

        log.println("Table names:") ;
        for (int i =0 ; i < tabNames.length; i++) {
            log.println("  " + tabNames[i]) ;
        }

        XServiceInfo info = null ;
        try {
            info = (XServiceInfo) UnoRuntime.queryInterface
                (XServiceInfo.class, tabs.getByName(tabNames[0])) ;
        } catch (com.sun.star.uno.Exception e) {}

        log.println("Support : " +
            info.supportsService("com.sun.star.sdbcx.Table")) ;
       
View Full Code Here

        if (oInstance == null) {
            log.println("ObjRelation(\"INSTANCE" + Index +"\") Object n.a.");
        }

        log.println("getting the existant object's name");
        XNameAccess oNameAccess = (XNameAccess)UnoRuntime.queryInterface(
                                                       XNameAccess.class, oObj);
        oNames = oNameAccess.getElementNames();
        /* Some Objects can't replace the firsr that comes along, i.e.
           SwXStyleFamily. It have some pool styles which can't be replaced.
           So the test need a special object to replace it by name.
        */
        log.println("get ObjRelation(\"NAMEREPLACE\")");
View Full Code Here

     * one element.
     */
    public void _getBookmarks() {
        boolean res = false;

        XNameAccess the_bookmarks = oObj.getBookmarks();
        log.println("Found: ");
        util.dbg.printArray(the_bookmarks.getElementNames());
        res = the_bookmarks.getElementNames().length>0;

        tRes.tested("getBookmarks()",res);
    }
View Full Code Here

        mediaDescr[0][0].Name = "URL";
        mediaDescr[0][0].Value = url;
   
        String type = ((XTypeDetection)UnoRuntime.queryInterface(XTypeDetection.class, typeDetect)).queryTypeByDescriptor(mediaDescr, true);
       
        XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class,typeDetect);
        if (type.equals(""))
            return null;
        else
            return (PropertyValue[]) xNameAccess.getByName(type);
    }
View Full Code Here

   
    public static PropertyValue[] getTypeMediaDescriptor(XMultiServiceFactory xmsf, String type)
        throws Exception
    {
        Object typeDetect = xmsf.createInstance("com.sun.star.document.TypeDetection");
        XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class,typeDetect);
        return (PropertyValue[]) xNameAccess.getByName(type);
    }
View Full Code Here

        // first we write what we are intend to do to log file
        log.println("craeting a test environment");

        log.println("getting column");
        XSpreadsheets xSpreadsheets = (XSpreadsheets)xSheetDoc.getSheets();
        XNameAccess oNames = (XNameAccess)
            UnoRuntime.queryInterface( XNameAccess.class, xSpreadsheets );
        XSpreadsheet xSpreadsheet = null;
        try {
            xSpreadsheet = (XSpreadsheet) AnyConverter.toObject(
                new Type(XSpreadsheet.class),
                    oNames.getByName(oNames.getElementNames()[0]));
        } catch (com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get spreadsheet", e);
        } catch (com.sun.star.container.NoSuchElementException e) {
            e.printStackTrace(log);
View Full Code Here

    private void  getTableColumns(String TableName)
        {
            try
            {
                XNameAccess xAllTextTables = oTextTableHandler.xTextTablesSupplier.getTextTables();
                if (xAllTextTables.hasByName(TableName) == true)
                {
                    Object oTextTable = xAllTextTables.getByName(TableName);
                    xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oTextTable);
                    xTextTable = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, oTextTable);
                    xTableName = (XNamed) UnoRuntime.queryInterface(XNamed.class, oTextTable);
                    xTableColumns = xTextTable.getColumns();
                }
View Full Code Here

        //setting property 'PrintHeaders' of the style 'Default'
        XStyleFamiliesSupplier xSFS = (XStyleFamiliesSupplier) UnoRuntime.queryInterface(
                                              XStyleFamiliesSupplier.class,
                                              xSheetDoc);
        XNameAccess xNA = xSFS.getStyleFamilies();
        XPropertySet xPropSet = null;

        try {
            Object oPageStyles = xNA.getByName("PageStyles");
            xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
                                                          oPageStyles);

            Object oDefStyle = xNA.getByName("Default");
            xPropSet = (XPropertySet) UnoRuntime.queryInterface(
                               XPropertySet.class, oDefStyle);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            e.printStackTrace(log);
            throw new StatusException(Status.failed("Couldn't get element"));
View Full Code Here


    public void insertControlInContainer(String _fieldname){
    try {
        if (xFormName != null){
            XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xFormName);
            String sControlName = Desktop.getUniqueName(xNameAccess, getControlName(_fieldname));
            xPropertySet.setPropertyValue("Name", sControlName);
            xFormName.insertByName(sControlName, xControlModel);
        }              
    } catch (Exception 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.