Examples of XBookmarksSupplier


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

       
        // 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

       
        // 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

        } 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

    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

   *
   * @author Markus Kr�ger
   */
  public IBookmark[] getBookmarks() {
    try {
      XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier) UnoRuntime.queryInterface(XBookmarksSupplier.class,
          textDocument.getXTextDocument());
      if (xBookmarksSupplier == null)
        return new IBookmark[0];
      XNameAccess nameAccess = xBookmarksSupplier.getBookmarks();
      String[] names = nameAccess.getElementNames();
      if (names.length < 1)
        return new IBookmark[0];
      List bookmarks = new ArrayList();
      for (int i = 0; i < names.length; i++) {
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

   */
  public IBookmark getBookmark(String name) {
    try {
      if (name == null)
        return null;
      XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier) UnoRuntime.queryInterface(XBookmarksSupplier.class,
          textDocument.getXTextDocument());
      if (xBookmarksSupplier == null)
        return null;
      Object bookmark = xBookmarksSupplier.getBookmarks().getByName(name);
      XTextContent xBookmarkContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class,
          bookmark);
      XNamed xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, bookmark);
      if (xBookmarkContent == null)
        return null;
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

   *
   * @author Markus Kr�ger
   */
  public IBookmark[] getBookmarks() {
    try {
      XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier) UnoRuntime
          .queryInterface(XBookmarksSupplier.class, textDocument
              .getXTextDocument());
      if (xBookmarksSupplier == null)
        return new IBookmark[0];
      XNameAccess nameAccess = xBookmarksSupplier.getBookmarks();
      String[] names = nameAccess.getElementNames();
      if (names.length < 1)
        return new IBookmark[0];
      List bookmarks = new ArrayList();
      for (int i = 0; i < names.length; i++) {
View Full Code Here

Examples of com.sun.star.text.XBookmarksSupplier

   */
  public IBookmark getBookmark(String name) {
    try {
      if (name == null)
        return null;
      XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier) UnoRuntime
          .queryInterface(XBookmarksSupplier.class, textDocument
              .getXTextDocument());
      if (xBookmarksSupplier == null)
        return null;
      Object bookmark = xBookmarksSupplier.getBookmarks().getByName(name);
      XTextContent xBookmarkContent = (XTextContent) UnoRuntime
          .queryInterface(XTextContent.class, bookmark);
      XNamed xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class,
          bookmark);
      if (xBookmarkContent == null)
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.