Examples of XSimpleText


Examples of com.sun.star.text.XSimpleText

                "com.sun.star.comp.Writer.XMLExporter", new Object[] {arg});
            XExporter xEx = (XExporter) UnoRuntime.queryInterface
                (XExporter.class,oObj);
            xEx.setSourceDocument(xTextDoc);

            XSimpleText aText = xTextDoc.getText();
            XTextCursor curs = (XTextCursor) aText.createTextCursor();
                        aText.insertString(curs, TEST_STR, false);
        } 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.text.XSimpleText

        // Shapes de titre
        XShape shape = findShapeByType(page, SHAPE_TYPE_TITLETEXT);

        if (shape != null) {
          XSimpleText xSimpleText = unoCast(XSimpleText.class, shape);

          // Recherche du nom de la page maitresse (= style de
          // page)
          XMasterPageTarget xMasterPageTarget = unoCast(
              XMasterPageTarget.class, page);
          XDrawPage xMasterPage = xMasterPageTarget.getMasterPage();
          XPropertySet masterSet = unoCast(XPropertySet.class,
              xMasterPage);

          // Ajout de la page a la liste de resultat
          try {
            result.add(new SlideDesc(xSimpleText.getString(),
                pageNumber, (String) masterSet
                    .getPropertyValue("LinkDisplayName")));
          } catch (ImpressWarning e) {
          }
        }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

      XDrawPage planPage = findPageByIndex(planIndex);

      // Shape de titre
      XShape titleShape = findShapeByType(planPage, SHAPE_TYPE_TITLETEXT);
      if (titleShape != null) {
        XSimpleText titleText = unoCast(XSimpleText.class, titleShape);
        titleText.setString(bundle.getShortTocTitle());
      }

      // Shape principal
      XShape mainShape = findShapeByType(planPage, SHAPE_TYPE_OUTLINER);
      if (mainShape != null) {
        XSimpleText mainText = unoCast(XSimpleText.class, mainShape);

        XTextCursor cursor = mainText.createTextCursor();
        cursor.getStart();

        XPropertySet xCursorProps = unoCast(XPropertySet.class, cursor);
        TabStop[] tabStops = new TabStop[1];
        tabStops[0] = new TabStop(bundle.getShortTocTabulation(),
            TabAlign.RIGHT, ',', '.');
        xCursorProps.setPropertyValue("ParaTabStops", tabStops);

        StringBuilder planBuilder = new StringBuilder();
        String newLine = "";
        for (SlideDesc slide : toc.getAllSlides()) {
          if (slide.getLevel() == 1) {
            planBuilder.append(newLine);
            planBuilder.append(slide.getTitle());
            planBuilder.append("\t");
            planBuilder.append(slide.getPage());
            newLine = "\n";
          }
        }
        mainText.setString(planBuilder.toString());

      }

      // Shape de notes
      XPresentationPage xPresentationPage = unoCast(
          XPresentationPage.class, planPage);
      XDrawPage planNotesPage = xPresentationPage.getNotesPage();
      XShape notesShape = findShapeByType(planNotesPage, SHAPE_TYPE_NOTES);
      if (notesShape != null) {
        XSimpleText notesText = unoCast(XSimpleText.class, notesShape);
        notesText.setString(bundle.getShortTocNotesText());
      }

    } catch (Exception e) {
      throw new ImpressException(e);
    }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

            // Get the XFootnote interface to the first footnote inserted ('Numbers')
            XFootnote xNumbers = ( XFootnote ) UnoRuntime.queryInterface (
                XFootnote.class, xFootnotes.getByIndex( 0 ) );

            // Get the XSimpleText interface to the Footnote
            XSimpleText xSimple = (XSimpleText ) UnoRuntime.queryInterface (
                XSimpleText.class, xNumbers );
           
            // Create a text cursor for the foot note text
            XTextRange xRange = (XTextRange ) UnoRuntime.queryInterface (
                XTextRange.class, xSimple.createTextCursor() );
           
            // And insert the actual text of the footnote.
            xSimple.insertString (
                xRange, "  The numbers were generated by using java.util.Random", false );
        }
        catch (Exception e)
        {
            e.printStackTrace();
View Full Code Here

Examples of com.sun.star.text.XSimpleText

        log.println("creating a test environment");

        // get the bodytext of textdocument here
        log.println("getting the TextCursor");

        final XSimpleText aText = xTextDoc.getText();
        final XTextCursor textCursor = aText.createTextCursor();
        oObj = textCursor;

        TestEnvironment tEnv = new TestEnvironment(oObj);

        return tEnv;
View Full Code Here

Examples of com.sun.star.text.XSimpleText

    private void setupBookmarks()
        throws com.sun.star.uno.Exception
    {
        XText xText = m_xDoc.getText();
        XSimpleText xSimpleText = (XSimpleText)UnoRuntime.queryInterface(
            XSimpleText.class,
            xText);
        for(int nPara=0; nPara<10; ++nPara) {
            for(int nBookmark=0; nBookmark<100; ++nBookmark){
                insertBookmark(
View Full Code Here

Examples of com.sun.star.text.XSimpleText

        CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale");
    }

    public static XTextCursor createTextCursor(Object oCursorContainer)
    {
        XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface(XSimpleText.class, oCursorContainer);
        XTextCursor xTextCursor = xText.createTextCursor();
        return xTextCursor;
    }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

        CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale");
    }
   
   
    public static XTextCursor createTextCursor(Object oCursorContainer) {
        XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface(XSimpleText.class, oCursorContainer);
        XTextCursor xTextCursor = xText.createTextCursor();
        return xTextCursor;
    }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

                    // Get the XFootnote interface to the first footnote inserted ('Numbers')
                    XFootnote xNumbers = ( XFootnote ) UnoRuntime.queryInterface (
                            XFootnote.class, xFootnotes.getByIndex( 0 ) );

                    // Get the XSimpleText interface to the Footnote
                    XSimpleText xSimple = (XSimpleText ) UnoRuntime.queryInterface (
                            XSimpleText.class, xNumbers );

                    // Create a text cursor for the foot note text
                    XTextRange xRange = (XTextRange ) UnoRuntime.queryInterface (
                            XTextRange.class, xSimple.createTextCursor() );

                    // And insert the actual text of the footnote.
                    xSimple.insertString (
                            xRange, "  The numbers were generated by using java.util.Random", false );
            }
            catch (Exception e)
            {
                    e.printStackTrace ( System.out );
View Full Code Here

Examples of com.sun.star.text.XSimpleText

                    // Getting the cell of the bug id
                    XCell xcell = xcellrange.getCellByPosition(
                    this.INT_COLUMN_FEATURE, intRow );
                   
                    // Querying for the interface XSimpleText
                    XSimpleText xsimpletext = ( XSimpleText )
                    UnoRuntime.queryInterface( XSimpleText.class, xcell );
                   
                    // Getting the text cursor
                    XTextCursor xtextcursor = xsimpletext.createTextCursor();
                   
                    // Querying for the interface XTextRange
                    XTextRange xtextrange = ( XTextRange )
                    UnoRuntime.queryInterface( XTextRange.class, xtextcursor );
                   
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.