Examples of XBookmarksSupplier


Examples of com.sun.star.sdb.XBookmarksSupplier


    public void createDBLink(Object oDataSource, String StorePath){
    try{
      String sBookmarkName = Tools.getFileDescription(StorePath);
  XBookmarksSupplier xBookmarksSuppl = (XBookmarksSupplier) UnoRuntime.queryInterface(XBookmarksSupplier.class, oDataSource);
  XNameAccess xBookmarks = xBookmarksSuppl.getBookmarks();
  boolean bLinkexists = true;
  String sBaseBookmarkName = sBookmarkName;
  int i = 1;
  while (bLinkexists == true){
      bLinkexists = xBookmarks.hasByName(sBookmarkName);
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

                    XTextFramesSupplier.class, xParent );

      oNA = oTTS.getTextFrames();
    }
    if ( iDsc instanceof BookmarkDsc ) {
      XBookmarksSupplier oTTS = (XBookmarksSupplier)
          UnoRuntime.queryInterface(
                    XBookmarksSupplier.class, xParent );

      oNA = oTTS.getBookmarks();
    }

    if ( iDsc instanceof FootnoteDsc ) {
      XFootnotesSupplier oTTS = (XFootnotesSupplier)
          UnoRuntime.queryInterface(
                    XFootnotesSupplier.class, xParent );

      return( oTTS.getFootnotes() );
    }

    if ( iDsc instanceof TextSectionDsc ) {
      XTextSectionsSupplier oTSS = (XTextSectionsSupplier)
          UnoRuntime.queryInterface(
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

        } catch( com.sun.star.uno.Exception e ) {
            e.printStackTrace( log );
            throw new StatusException( "Couldn't create Bookmark", e );
        }

        XBookmarksSupplier oBSupp = (XBookmarksSupplier)
            UnoRuntime.queryInterface(XBookmarksSupplier.class, xTextDoc);
        XNameAccess oBookNA = oBSupp.getBookmarks();
        oObj = oBookNA;
        log.println( "creating a new environment for Bookmarks object" );

        TestEnvironment tEnv = new TestEnvironment( oObj );
        return tEnv;
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

       
        // get XTextFieldsSupplier, XBookmarksSupplier interfaces
        XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier)
            UnoRuntime.queryInterface(XTextFieldsSupplier.class,
                                      xTemplateComponent);
        XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier)
            UnoRuntime.queryInterface(XBookmarksSupplier.class, xTemplateComponent);
       
        // access the TextFields and the TextFieldMasters collections
        XNameAccess xNamedFieldMasters = xTextFieldsSupplier.getTextFieldMasters();
        XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields();
       
        // iterate over hashtable and insert values into field masters
        java.util.Enumeration keys = recipient.keys();
        while(keys.hasMoreElements()) {
            // get column name
            String key = (String)keys.nextElement();
           
            // access corresponding field master
            Object fieldMaster = xNamedFieldMasters.getByName(
                "com.sun.star.text.fieldmaster.User." + key);
           
            // query the XPropertySet interface, we need to set the Content property
            XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, fieldMaster);
           
            // insert the column value into field master
            xPropertySet.setPropertyValue("Content", recipient.get(key));
        }
        // afterwards we must refresh the textfields collection
        XRefreshable xRefreshable = (XRefreshable)UnoRuntime.queryInterface(
            XRefreshable.class, xEnumeratedFields);
        xRefreshable.refresh();

        // accessing the Bookmarks collection of the document
        XNameAccess xNamedBookmarks = xBookmarksSupplier.getBookmarks();
       
        // find the bookmark named "Subscription"
        Object bookmark = xNamedBookmarks.getByName("Subscription");
        // we need its XTextRange which is available from getAnchor(),
        // so query for XTextContent
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

    static public java.math.BigInteger getBookmarksHash(XTextDocument xDoc)
        throws com.sun.star.uno.Exception, java.security.NoSuchAlgorithmException
    {
        StringBuffer buffer = new StringBuffer("");
        XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier)UnoRuntime.queryInterface(
            XBookmarksSupplier.class,
            xDoc);
        XNameAccess xBookmarks = xBookmarksSupplier.getBookmarks();
        for(String sBookmarkname : xBookmarks.getElementNames()) {
            Object xBookmark = xBookmarks.getByName(sBookmarkname);
            XTextContent xBookmarkAsContent = (XTextContent)UnoRuntime.queryInterface(
                XTextContent.class,
                xBookmark);
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

            newDocComponentFromTemplate( sTemplateFileUrl.toString() );
       
        // get XTextFieldsSupplier, XBookmarksSupplier interfaces
        XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier)UnoRuntime.queryInterface(
            XTextFieldsSupplier.class, xTemplateComponent);
        XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier)UnoRuntime.queryInterface(
            XBookmarksSupplier.class, xTemplateComponent);
       
        // access the TextFields and the TextFieldMasters collections
        XNameAccess xNamedFieldMasters = xTextFieldsSupplier.getTextFieldMasters();
        XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields();
       
        // iterate over hashtable and insert values into field masters
        java.util.Enumeration keys = recipient.keys();
        while(keys.hasMoreElements()) {
            // get column name
            String key = (String)keys.nextElement();
           
            // access corresponding field master
            Object fieldMaster = xNamedFieldMasters.getByName(
                "com.sun.star.text.FieldMaster.User." + key);
           
            // query the XPropertySet interface, we need to set the Content property
            XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, fieldMaster);
           
            // insert the column value into field master
            xPropertySet.setPropertyValue("Content", recipient.get(key));
        }
        // afterwards we must refresh the textfields collection
        XRefreshable xRefreshable = (XRefreshable)UnoRuntime.queryInterface(
            XRefreshable.class, xEnumeratedFields);
        xRefreshable.refresh();

        // accessing the Bookmarks collection of the document
        XNameAccess xNamedBookmarks = xBookmarksSupplier.getBookmarks();
       
        // find the bookmark named "Subscription"
        Object bookmark = xNamedBookmarks.getByName("Subscription");
        // we need its XTextRange which is available from getAnchor(),
        // so query for XTextContent
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

                    XTextFramesSupplier.class, xParent );

      oNA = oTTS.getTextFrames();
    }
    if ( iDsc instanceof BookmarkDsc ) {
      XBookmarksSupplier oTTS = (XBookmarksSupplier)
          UnoRuntime.queryInterface(
                    XBookmarksSupplier.class, xParent );

      oNA = oTTS.getBookmarks();
    }

    if ( iDsc instanceof FootnoteDsc ) {
      XFootnotesSupplier oTTS = (XFootnotesSupplier)
          UnoRuntime.queryInterface(
                    XFootnotesSupplier.class, xParent );

      return( oTTS.getFootnotes() );
    }

    if ( iDsc instanceof TextSectionDsc ) {
      XTextSectionsSupplier oTSS = (XTextSectionsSupplier)
          UnoRuntime.queryInterface(
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

        } catch( com.sun.star.uno.Exception e ) {
            e.printStackTrace( log );
            throw new StatusException( "Couldn't create Bookmark", e );
        }

        XBookmarksSupplier oBSupp = (XBookmarksSupplier)
            UnoRuntime.queryInterface(XBookmarksSupplier.class, xTextDoc);
        XNameAccess oBookNA = oBSupp.getBookmarks();
        oObj = oBookNA;
        log.println( "creating a new environment for Bookmarks object" );

        TestEnvironment tEnv = new TestEnvironment( oObj );
        return tEnv;
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

        XRepositorySupplier xRS = (XRepositorySupplier)
            UnoRuntime.queryInterface(XRepositorySupplier.class, xTextDoc);
        XDocumentRepository xRepo = (XDocumentRepository)
            UnoRuntime.queryInterface(XDocumentRepository.class,
                xRS.getRDFRepository());
        XBookmarksSupplier xBMS = (XBookmarksSupplier)
            UnoRuntime.queryInterface(XBookmarksSupplier.class, xTextDoc);
        XNameAccess xBookmarks = xBMS.getBookmarks();
        XMetadatable xMark1 = (XMetadatable) UnoRuntime.queryInterface(
                XMetadatable.class, xBookmarks.getByName("mk1"));
        assertTrue("mark1",
                eq(xMark1.getMetadataReference(),
                    new StringPair("content.xml", "id90")));
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

    static public java.math.BigInteger getBookmarksHash(XTextDocument xDoc)
        throws com.sun.star.uno.Exception, java.security.NoSuchAlgorithmException
    {
        StringBuffer buffer = new StringBuffer("");
        XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier)UnoRuntime.queryInterface(
            XBookmarksSupplier.class,
            xDoc);
        XNameAccess xBookmarks = xBookmarksSupplier.getBookmarks();
        for(String sBookmarkname : xBookmarks.getElementNames()) {
            Object xBookmark = xBookmarks.getByName(sBookmarkname);
            XTextContent xBookmarkAsContent = (XTextContent)UnoRuntime.queryInterface(
                XTextContent.class,
                xBookmark);
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.