Package ag.ion.bion.officelayer.text

Examples of ag.ion.bion.officelayer.text.ITextDocument


    try {
      IOfficeApplication officeAplication = OfficeApplicationRuntime.getApplication(configuration);
      officeAplication.activate();
      IDocumentService documentService = officeAplication.getDocumentService();
      IDocument document = documentService.constructNewDocument("TestDocument",documentDescriptor);
      ITextDocument textDocument = (ITextDocument)document;
      textDocument.addCloseListener(new SnippetDocumentCloseListener(officeAplication));
     
      /*
       * This stuff was already discussed in Snippet2 but now lets begin to
       * work with tables in text documents
       */
 
View Full Code Here


    try {
      IOfficeApplication officeAplication = OfficeApplicationRuntime.getApplication(configuration);
      officeAplication.activate();
      IDocumentService documentService = officeAplication.getDocumentService();
      IDocument document = documentService.constructNewDocument(IDocument.WRITER, DocumentDescriptor.DEFAULT);
      ITextDocument textDocument = (ITextDocument)document;
      textDocument.addCloseListener(new SnippetDocumentCloseListener(officeAplication));
     
      /*
       * Now do the work with text content.
       */
      placeSomeTextContent(textDocument);
 
View Full Code Here

   * @author Sebastian R�sgen
   * @author Markus Kr�ger
   */
  public void markTextField() {
    try {
      ITextDocument textDocument = getTextDocument();
      textDocument.setSelection(new TextRangeSelection(getTextRange()));

      /*
       * XTextDocument xTextDocument=
       * getTextDocument().getXTextDocument(); Object master1 =
       * xDependentTextField.getTextFieldMaster(); XText anchorText =
View Full Code Here

    try {
      IOfficeApplication officeApplication = OfficeApplicationRuntime.getApplication(hashMap);
      officeApplication.activate();
     
      System.out.println("Constructing a new writer document ...");
      ITextDocument textDocument = (ITextDocument)officeApplication.getDocumentService().constructNewDocument(IDocument.WRITER, DocumentDescriptor.DEFAULT_HIDDEN);
      System.out.println("Inserting text into the new writer document ...");
      textDocument.getTextService().getText().setText("This is a NOA test.");
      System.out.println("Storing new writer document ...");
      textDocument.getPersistenceService().store(new FileOutputStream("noatest.odt"));
      textDocument.close();
      officeApplication.deactivate();
     
    }
    catch(Throwable throwable) {
      throwable.printStackTrace();
View Full Code Here

      officeAplication.activate();
      IDocumentService documentService = officeAplication.getDocumentService();
      IDocument document = documentService.constructNewDocument(
          IDocument.WRITER, new DocumentDescriptor());

      ITextDocument textDocument = (ITextDocument) document;

      boolean useStream = true;
      GraphicInfo graphicInfo = null;

      String imagePath = "d:\\my_image.gif";
      int pixelWidth = 265;
      int pixelHeight = 256;

      if(!useStream) {
        //with url
        graphicInfo = new GraphicInfo(imagePath, pixelWidth, true, pixelHeight, true,
            VertOrientation.TOP, HoriOrientation.LEFT,
            TextContentAnchorType.AT_PARAGRAPH);
      }
      else {
        //with stream
        graphicInfo = new GraphicInfo(new FileInputStream(imagePath), pixelWidth,
            true, pixelHeight, true, VertOrientation.TOP, HoriOrientation.LEFT,
            TextContentAnchorType.AT_PARAGRAPH);
      }

      ITextContentService textContentService = textDocument.getTextService()
          .getTextContentService();

      ITextCursor textCursor = textDocument.getTextService().getText()
          .getTextCursorService().getTextCursor();

      ITextDocumentImage textDocumentImage = textContentService
          .constructNewImage(graphicInfo);
      textContentService.insertTextContent(textCursor.getEnd(),
View Full Code Here

    try {
      officeAplication = OfficeApplicationRuntime.getApplication(configuration);
      officeAplication.activate();
      IDocumentService documentService = officeAplication.getDocumentService();
      IDocument document = documentService.constructNewDocument(IDocument.WRITER, DocumentDescriptor.DEFAULT);
      ITextDocument textDocument = (ITextDocument)document;
      textDocument.addCloseListener(new InternalCloseListener());
    }
    catch (OfficeApplicationException exception) {
      exception.printStackTrace();
    }
    catch (NOAException exception) {
View Full Code Here

      configuration.put(IOfficeApplication.APPLICATION_TYPE_KEY, IOfficeApplication.LOCAL_APPLICATION);
      final IOfficeApplication officeAplication = OfficeApplicationRuntime.getApplication(configuration);
      officeAplication.setConfiguration(configuration);
      officeAplication.activate();
      IDocumentService documentService = officeAplication.getDocumentService();
      ITextDocument textDocument = (ITextDocument)documentService.constructNewDocument(IDocument.WRITER, DocumentDescriptor.DEFAULT);

      //construct table
      int rows = 15;
      int cols = 5;
      ITextTable textTable = textDocument.getTextTableService().constructTextTable(rows, cols);      
      textDocument.getTextService().getTextContentService().insertTextContent(textTable);
      textTable.setHeaderRows(3);
      //set some text
      for(int i = 0, n = rows; i < n; i++) {
        for(int j = 0, m = cols; j < m; j++) {
          IText cellText = textTable.getCell(j,i).getTextService().getText();
View Full Code Here

    try {
      IOfficeApplication officeAplication = OfficeApplicationRuntime.getApplication(configuration);
      officeAplication.activate();
      IDocumentService documentService = officeAplication.getDocumentService();
      IDocument document = documentService.constructNewDocument(IDocument.WRITER, DocumentDescriptor.DEFAULT);
      ITextDocument textDocument = (ITextDocument)document;
      textDocument.addCloseListener(new SnippetDocumentCloseListener(officeAplication));

      /*
       * Now do the work with text content.
       */
      placeSomeTextContent(textDocument);
 
View Full Code Here

    transmittedData = null;
  }

  private void removeDummyString() {
    ITextDocument textDocument = null;

    textDocument = getCurrentTextDocument();

    IViewCursor viewCursor = textDocument.getViewCursorService()
        .getViewCursor();
    ITextCursor textCursor = viewCursor.getTextCursorFromEnd();
    textCursor.goLeft((short) DUMMY_INSERT_STRING.length(), true);
    textCursor.setString(""); //$NON-NLS-1$
  }
View Full Code Here

      String dateiNeu = "p:/tests/bsp1NEU.doc";
      IOfficeApplication officeAplication = OfficeApplicationRuntime.getApplication(configuration);
      officeAplication.activate();
      IDocumentService documentService = officeAplication.getDocumentService();
      IDocument document = documentService.loadDocument(datei, DocumentDescriptor.DEFAULT);
      ITextDocument textDocument = (ITextDocument) document;

      ITextService textService = textDocument.getTextService();
      IBookmarkService bookmarkService = textService.getBookmarkService();
      IBookmark bookmark = bookmarkService.getBookmark("Status");
      String name = bookmark.getName();
      bookmark.setText("In Arbeit NEU345");
      textDocument.getTextFieldService().refresh();
      document.getPersistenceService().export(dateiNeu, new MSOffice97Filter());
      textDocument.close();
      document.close();
      officeAplication.dispose();
    }
    catch (Exception exception) {
      exception.printStackTrace();
View Full Code Here

TOP

Related Classes of ag.ion.bion.officelayer.text.ITextDocument

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.