Package com.sun.star.container

Examples of com.sun.star.container.XNamed


       
        tEnv.addObjRelation("Comparer",
                            new Comparator() {
            public int compare(Object o1, Object o2) {
                XNamed named1 = (XNamed) UnoRuntime.queryInterface(
                                        XNamed.class, o1);
                XNamed named2 = (XNamed) UnoRuntime.queryInterface(
                                        XNamed.class, o2);

                if (named1.getName().equals(named2.getName())) {
                    return 0;
                }

                return -1;
            }
View Full Code Here


                oDocMSF.createInstance( "com.sun.star.text.ReferenceMark" );
        } catch ( com.sun.star.uno.Exception e ) {
            e.printStackTrace( log );
            throw new StatusException( "Couldn't get ReferenceMark", e);
        }
        XNamed oObjN = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj);
        oObjN.setName(Name);
        XTextContent oObjTC = (XTextContent)
            UnoRuntime.queryInterface(XTextContent.class, oObj);
        XTextCursor oCursor = oText.createTextCursor();
        try {
            oText.insertTextContent(oCursor, oObjTC, false);
        } catch ( com.sun.star.lang.IllegalArgumentException e ){
            e.printStackTrace( log );
            throw new StatusException(" Couldn't insert ReferenceMark01", e);
        }

        // Creation and insertion of ReferenceMark02
        try {
            oObj = (XInterface)
                oDocMSF.createInstance( "com.sun.star.text.ReferenceMark" );
        } catch ( com.sun.star.uno.Exception e ) {
            e.printStackTrace( log );
            throw new StatusException( "Couldn't get ReferenceMark", e);
        }
        XNamed oObjN2 = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj);
        oObjN2.setName(Name2);

        XTextContent oObjTC2 = (XTextContent)
            UnoRuntime.queryInterface(XTextContent.class, oObj);
        try {
            oText.insertTextContent(oCursor, oObjTC2, false);
View Full Code Here

    public void linkSectiontoTemplate(Object oTextSection, String TemplateName, String SectionName) {
        SectionFileLink oSectionLink = new SectionFileLink();
        oSectionLink.FileURL = TemplateName;
        Helper.setUnoPropertyValues(oTextSection, new String[] { "FileLink", "LinkRegion" }
        , new Object[] { oSectionLink, SectionName });
        XNamed xSectionName = (XNamed) UnoRuntime.queryInterface(XNamed.class, oTextSection);
        String NewSectionName = xSectionName.getName();
        if (NewSectionName.compareTo(SectionName) != 0)
            xSectionName.setName(SectionName);
    }
View Full Code Here

    public void renameTextTable(String OldTableName, String NewTableName) {
        try {
            XNameAccess xTextTableNames = xTextTablesSupplier.getTextTables();
            if (xTextTableNames.hasByName(OldTableName)) {
                Object oTextTable = xTextTableNames.getByName(OldTableName);
                XNamed xTextTableName = (XNamed) UnoRuntime.queryInterface(XNamed.class, oTextTable);
                xTextTableName.setName(NewTableName);
            }
        } catch (Exception exception) {
            exception.printStackTrace(System.out);
        }
    }
View Full Code Here

                    new Type (XInterface.class), IA.getByIndex (i));
                XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, IA.getByIndex (i));
                if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ())
                {
                    xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield);
                    XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i));
                    System.out.println ("name: "+xNamed.getName ());
                    dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo");
                }
            }
            groups = dpgi.Groups;
            XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups);           
View Full Code Here

            // assigning a draw page a new name
            XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier)
                UnoRuntime.queryInterface
                (XDrawPagesSupplier.class, xImpressDoc) ;
            XDrawPages xPages = xPagesSup.getDrawPages() ;
            XNamed xPageName = (XNamed) UnoRuntime.queryInterface
                (XNamed.class, xPages.getByIndex(0)) ;
            xPageName.setName(expPageName) ;
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
        }
View Full Code Here

                e.printStackTrace(log);
                tRes.tested("getDataPilotFields()", false);
                return;
            }

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

            log.print("Field : '" + name + "' ... ") ;

            if (!name.equals("Data")) {
View Full Code Here

        try {
            log.print("Fields returned ") ;
            for (int i = 0; i < IA.getCount(); i++) {
                Object field = IA.getByIndex(i);
                XNamed named = (XNamed)UnoRuntime.queryInterface
                    (XNamed.class, field);
                name = named.getName();
                log.print(" " + name) ;
                if (fieldsNames[rem].equals(name)) {
                    log.println(" - OK") ;
                    return true ;
                }
View Full Code Here

                UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
            XDrawPages drawPages = drawPagesSupplier.getDrawPages();
            //insert new draw page
            XDrawPage newDrawPage = drawPages.insertNewByIndex(0);
            //set specific test name
            XNamed newPageNamed = (XNamed)
                UnoRuntime.queryInterface(XNamed.class, newDrawPage);
            newPageNamed.setName(NAME);
            XExporter xEx = (XExporter)
                UnoRuntime.queryInterface(XExporter.class,oObj);
            xEx.setSourceDocument(xImpressDoc);

        } catch (com.sun.star.uno.Exception e) {
View Full Code Here

            UnoRuntime.queryInterface(XIndexAccess.class, oTSSuppName);

            log.println( "getting a TextSection with the XTextSectionSupplier()" );
            xTS = (XTextSection) AnyConverter.toObject(
                        new Type(XTextSection.class),oTSSuppIndex.getByIndex(0));
            XNamed xTSName = (XNamed)
                    UnoRuntime.queryInterface( XNamed.class, xTS);
            xTSName.setName("SwXTextSection");
        }
        catch(Exception e){
            System.out.println("Couldn't get Textsection " + e);
        }
View Full Code Here

TOP

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

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.