Examples of XNamed


Examples of com.sun.star.container.XNamed

                e.printStackTrace(log);

                return;
            }

            XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class,
                                                              field);
            String name = named.getName();

            log.println("**Field : '" + name + "' ... ");

            if (!name.equals("Data")) {
                fieldsNames[cnt] = name;
View Full Code Here

Examples of com.sun.star.container.XNamed

            // can not be exported to XML)
            set.insertNewByIndex(1);

            XDrawPage page1 = (XDrawPage)
                UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0));
            XNamed NPage1 = (XNamed)
                UnoRuntime.queryInterface(XNamed.class,page1);
            NPage1.setName("NewSlide1");
            XDrawPage page2 = (XDrawPage)
                UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1));
            XNamed NPage2 = (XNamed)
                UnoRuntime.queryInterface(XNamed.class,page2);
            NPage2.setName("NewSlide2");
            xEx.setSourceDocument(xDrawDoc);
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
        }
View Full Code Here

Examples of com.sun.star.container.XNamed

                    try {
                        XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier)
                            UnoRuntime.queryInterface
                            (XDrawPagesSupplier.class, xImpressDoc) ;
                        XDrawPages xPages = xPagesSup.getDrawPages() ;
                        XNamed xPageName = (XNamed) UnoRuntime.queryInterface
                            (XNamed.class, xPages.getByIndex(0)) ;
                        String gName = xPageName.getName() ;
                        logF.println("Page name returned = '" + gName + "'") ;
                        return impPageName.equals(gName) ;
                    } catch (com.sun.star.uno.Exception e) {
                        logF.println("Exception occured while checking filter :") ;
                        e.printStackTrace(logF) ;
View Full Code Here

Examples of com.sun.star.container.XNamed

            XIndexAccess formElements1 = (XIndexAccess) UnoRuntime.queryInterface(
                                                 XIndexAccess.class,
                                                 forms.getByName("MyForm"));

            for (int i = 0; i < formElements1.getCount(); i++) {
                XNamed elemName = (XNamed) UnoRuntime.queryInterface(
                                          XNamed.class,
                                          formElements1.getByIndex(i));
                log.println("   '" + elemName.getName() + "'");
            }


            // END DEBUG
            //put something on the drawpage
            log.println("inserting some ControlShapes");
            oShapes = DrawTools.getShapes(WriterTools.getDrawPage(xTextDoc));
            shape1 = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000,
                                                  1000, "CommandButton");
            shape2 = FormTools.createControlShape(xTextDoc, 5000, 3500, 7500,
                                                  5000, "TextField");

            XControlShape shape3 = FormTools.createControlShape(xTextDoc, 2000,
                                                                1500, 1000,
                                                                1000,
                                                                "CheckBox");
            oShapes.add((XShape) shape1);
            oShapes.add((XShape) shape2);
            oShapes.add(shape3);
        } catch (Exception e) {
            e.printStackTrace(log);
        }

        log.println("Forms after adding controls : ");
        formNames = forms.getElementNames();

        for (int i = 0; i < formNames.length; i++) {
            log.println("    '" + formNames[i] + "'");
        }

        try {
            log.println("Elements in the 'MyForm' :");

            XIndexAccess formElements1 = (XIndexAccess) UnoRuntime.queryInterface(
                                                 XIndexAccess.class,
                                                 forms.getByName("MyForm"));

            for (int i = 0; i < formElements1.getCount(); i++) {
                XNamed elemName = (XNamed) UnoRuntime.queryInterface(
                                          XNamed.class,
                                          formElements1.getByIndex(i));
                log.println("   '" + elemName.getName() + "'");
            }
        } catch (Exception e) {
            e.printStackTrace(log);
        }
View Full Code Here

Examples of com.sun.star.container.XNamed

            XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets();
            XIndexAccess xSheetsIndexArray = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
            XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject(
                    new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0));
            XNamed xSheetNamed = (XNamed)
                UnoRuntime.queryInterface(XNamed.class, xSheet);
            xSheetNamed.setName(SHEET_NAME);
           
            log.println("fill sheet with contnet...");
            util.CalcTools.fillCalcSheetWithContent(xSheet, 3, 3, 50, 50);
           
        } catch (com.sun.star.uno.Exception e) {
View Full Code Here

Examples of com.sun.star.container.XNamed

                e.printStackTrace(log);

                return;
            }

            XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class,
                                                              field);
            String name = named.getName();

            log.println("**Field : '" + name + "' ... ");

            if (!name.equals("Data")) {
                fieldsNames[cnt] = name;
View Full Code Here

Examples of com.sun.star.container.XNamed

            // This is an XML-export BUG (new slide named "NewSlide2" can not be exported to XML)
            set.insertNewByIndex(1);

            XDrawPage page1 = (XDrawPage)
                UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0));
            XNamed NPage1 = (XNamed)
                UnoRuntime.queryInterface(XNamed.class,page1);
            NPage1.setName("NewSlide1");
            XDrawPage page2 = (XDrawPage)
                UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1));
            XNamed NPage2 = (XNamed)
                UnoRuntime.queryInterface(XNamed.class,page2);
            NPage2.setName("NewSlide2");

            XExporter xEx = (XExporter)
                UnoRuntime.queryInterface(XExporter.class,oObj);
            xEx.setSourceDocument(xDrawDoc);
View Full Code Here

Examples of com.sun.star.container.XNamed

                     
            XDrawPage page = (XDrawPage) UnoRuntime.queryInterface(
                com.sun.star.drawing.XDrawPage.class, pages
                    .getByIndex(i));
           
            XNamed xPageName = (XNamed)UnoRuntime.queryInterface(XNamed.class,page);
           
            xPageName.setName("slide"+(i+1));
            //if(!xPageName.getName().equals("slide"+(i+1)) && !xPageName.getName().equals("page"+(i+1)))
              //xPageName.setName((i+1)+"-"+xPageName.getName());
            Object GraphicExportFilter = xMultiComponentFactory
                .createInstanceWithContext(
                    "com.sun.star.drawing.GraphicExportFilter",
                    xComponentContext);
            XExporter xExporter = (XExporter) UnoRuntime
                .queryInterface(XExporter.class,
                    GraphicExportFilter);

            XComponent xComp = (XComponent) UnoRuntime
                .queryInterface(XComponent.class, page);

            xExporter.setSourceDocument(xComp);
            loadProps[1] = new PropertyValue();
            loadProps[1].Name = "URL";
            loadProps[1].Value = remoteFolderFullPath+remoteFolder+"/"+xPageName.getName()+".png";
            loadProps[2] = new PropertyValue();
            loadProps[2].Name = "FilterData";
            loadProps[2].Value = filterDatas;
            loadProps[3] = new PropertyValue();
            loadProps[3].Name = "Quality";
            loadProps[3].Value = new Integer(100);
           
            XFilter xFilter = (XFilter) UnoRuntime.queryInterface(XFilter.class, GraphicExportFilter);

            xFilter.filter(loadProps);
            System.out.println(xPageName.getName()+".png");

            //System.out.println("Page saved to url "+loadProps[1].Value);
           
          }
         
View Full Code Here

Examples of com.sun.star.container.XNamed

          j++;
          slidename = slidenamebackup+j;
        }
        slidenames[nbPages-(i+1)] = slidename;
       
        XNamed xPageName = (XNamed)UnoRuntime.queryInterface(XNamed.class,page);
       
        xPageName.setName(slidename);       
       
              XMultiComponentFactory localServiceManager = ((DokeosSocketOfficeConnection)this.openOfficeConnection).getServiceManager();
        Object GraphicExportFilter = localServiceManager
            .createInstanceWithContext(
                "com.sun.star.drawing.GraphicExportFilter",
                ((DokeosSocketOfficeConnection)this.openOfficeConnection).getComponentContext());
       
        XExporter xExporter = (XExporter) UnoRuntime
            .queryInterface(XExporter.class,
                GraphicExportFilter);

        XComponent xComp = (XComponent) UnoRuntime
            .queryInterface(XComponent.class, page);

        xExporter.setSourceDocument(xComp);
        loadProps[1] = new PropertyValue();
        loadProps[1].Name = "URL";
       
       
       
        loadProps[1].Value = outputUrl+"/"+xPageName.getName()+".png";
        loadProps[2] = new PropertyValue();
        loadProps[2].Name = "FilterData";
        loadProps[2].Value = filterDatas;
        loadProps[3] = new PropertyValue();
        loadProps[3].Name = "Quality";
        loadProps[3].Value = new Integer(100);
       
        XFilter xFilter = (XFilter) UnoRuntime.queryInterface(XFilter.class, GraphicExportFilter);

        xFilter.filter(loadProps);
        if(slidenameDisplayed=="")
          slidenameDisplayed = xPageName.getName();
        System.out.println(slidenameDisplayed+"||"+xPageName.getName()+".png"+"||"+slidebody);
       
      }
     
    } finally {
      document.dispose();
View Full Code Here

Examples of com.sun.star.container.XNamed

                // check whether the columns supplied by the query match what we expected
                assure( "invalid column count (found " + columns.getCount() + ", expected: " + expectedColumnNames[i].length + ") for query \"" + queryNames[i] + "\"",
                    columns.getCount() == expectedColumnNames[i].length );
                for ( int col = 0; col < columns.getCount(); ++col )
                {
                    XNamed columnName = (XNamed)UnoRuntime.queryInterface(
                        XNamed.class, columns.getByIndex(col) );
                    assure( "column no. " + col + " of query \"" + queryNames[i] + "\" not matching",
                        columnName.getName().equals( expectedColumnNames[i][col] ) );
                }
            }
        }
        catch ( Exception e )
        {
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.