Package ag.ion.bion.officelayer.text

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


        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(),
          textDocumentImage);

      officeAplication.deactivate();
    }
    catch(OfficeApplicationException exception) {
View Full Code Here


   * @author Sebastian R�sgen
   */
  private IClonedObject clonePreprocessor(IDestinationPosition position, boolean adoptContent, boolean generateReturnValue, PropertyKeysContainer propertyKeysContainer) throws CloneException{
    try {
      ITextService service = document.getTextService();
      ITextContentService contentService = service.getTextContentService();
      if (contentService != null) {
         IParagraph newParagraph = contentService.constructNewParagraph();
         ITextRange range = null;
         if (ITextRange.class.isAssignableFrom(position.getType())) {
            range = (ITextRange)position.getDestinationObject();
         }
         if (range != null) {
            contentService.insertTextContent(range, newParagraph);
         }
         else {
          contentService.insertTextContentAfter(paragraph,newParagraph);
         }
         if (adoptContent) {
            newParagraph.setParagraphText(paragraphText)
         }
        
View Full Code Here

      ITextRange range = null;
      if (position.getType() != null && ITextRange.class.isAssignableFrom(position.getType())) {
        range = (ITextRange)position.getDestinationObject();
      }
      ITextDocument textDocument = textTable.getTextDocument();
      ITextContentService textContentService = textDocument.getTextService().getTextContentService();
      ITextTable newTable = textDocument.getTextTableService().constructTextTable(tablePropertyStore.getRows(), tablePropertyStore.getColumns());
           
      if (range != null) {
        textContentService.insertTextContent(range,newTable);
      }
      else {
        textContentService.insertTextContentAfter(newTable,textTable);
       }
     
      String[] propertyKeysToCopy = null;     
      if(propertyKeysContainer != null) {
        propertyKeysToCopy = propertyKeysContainer.getPropertyKeys(ITextTableProperties.TYPE_ID);       
      }
      else {
        //use default
        propertyKeysToCopy = TextTableProperties.getDefaultPropertyKeys();
      }
      if(propertyKeysToCopy != null) {
        ITextTableProperties newTableProperties = newTable.getProperties();
        ((IPropertyStore)tablePropertyStore).getProperties().copyTo(propertyKeysToCopy, newTableProperties);
      }
     
      int rowArrayLength = cellCloneServices.length;
      for (int rows = 0; rows < rowArrayLength; rows++) {
        //set row height
        newTable.getRow(rows).setHeight(textTable.getRow(rows).getHeight());
        newTable.getRow(rows).setAutoHeight(textTable.getRow(rows).getAutoHeight());
       
        int columnArrayLength = cellCloneServices[rows].length;
        for (int columns = 0; columns < columnArrayLength ; columns++) {
          ICloneService cellClone = cellCloneServices[rows][columns];
          ITextTableCell textTableCell = newTable.getCell(columns, rows);
          CloneDestinationPosition destinationCell = new CloneDestinationPosition(textTableCell, textTableCell.getClass());
          cellClone.cloneToPositionNoReturn(destinationCell, adoptContent,propertyKeysContainer);               
        }
      }
     
      if (createSpace) {
        IParagraph paragraph = textContentService.constructNewParagraph();
        textContentService.insertTextContentBefore(paragraph,newTable);
      }
      if(generateReturnValue)
        return new ClonedObject(newTable, newTable.getClass());
      else
        return null;
View Full Code Here

  private IClonedObject clonePreprocessor(IDestinationPosition position,
      boolean adoptContent, boolean generateReturnValue,
      PropertyKeysContainer propertyKeysContainer) throws CloneException {
    try {
      ITextService service = document.getTextService();
      ITextContentService contentService = service
          .getTextContentService();
      if (contentService != null) {
        IParagraph newParagraph = contentService
            .constructNewParagraph();
        ITextRange range = null;
        if (ITextRange.class.isAssignableFrom(position.getType())) {
          range = (ITextRange) position.getDestinationObject();
        }
        if (range != null) {
          contentService.insertTextContent(range, newParagraph);
        } else {
          contentService.insertTextContentAfter(paragraph,
              newParagraph);
        }
        if (adoptContent) {
          newParagraph.setParagraphText(paragraphText);
        }
View Full Code Here

      TextPosition position) {
    OODocument ooDocument = (OODocument) position.getTutorialDocument();
    ITextDocument textDocument = (ITextDocument) ooDocument.getDocument();
    ITextRange textRange = position.getTextRange();

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

    ITextDocumentTextShape textDocumentTextShape = null;
    try {
      textDocumentTextShape = textContentService.constructNewTextShape(textInfo);
      textContentService.insertTextContent(textRange, textDocumentTextShape);
      insertRenderedRTF(textDocument, textDocumentTextShape, textInfo);

    } catch (TextException e) {
      textDocumentTextShape = null;
      e.printStackTrace();
View Full Code Here

      TextPosition position) {
    OODocument ooDocument = (OODocument) position.getTutorialDocument();
    ITextDocument textDocument = (ITextDocument) ooDocument.getDocument();
    ITextRange textRange = position.getTextRange();

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

    ITextDocumentImage textDocumentImage = null;
    try {
      textDocumentImage = textContentService
          .constructNewImage(graphicInfo);
      textContentService.insertTextContent(textRange, textDocumentImage);
    } catch (TextException e) {
      textDocumentImage = null;
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

      if (position.getType() != null
          && ITextRange.class.isAssignableFrom(position.getType())) {
        range = (ITextRange) position.getDestinationObject();
      }
      ITextDocument textDocument = textTable.getTextDocument();
      ITextContentService textContentService = textDocument
          .getTextService().getTextContentService();
      ITextTable newTable = textDocument.getTextTableService()
          .constructTextTable(tablePropertyStore.getRows(),
              tablePropertyStore.getColumns());

      if (range != null) {
        textContentService.insertTextContent(range, newTable);
      } else {
        textContentService.insertTextContentAfter(newTable, textTable);
      }

      String[] propertyKeysToCopy = null;
      if (propertyKeysContainer != null) {
        propertyKeysToCopy = propertyKeysContainer
            .getPropertyKeys(ITextTableProperties.TYPE_ID);
      } else {
        // use default
        propertyKeysToCopy = TextTableProperties
            .getDefaultPropertyKeys();
      }
      if (propertyKeysToCopy != null) {
        ITextTableProperties newTableProperties = newTable
            .getProperties();
        ((IPropertyStore) tablePropertyStore).getProperties().copyTo(
            propertyKeysToCopy, newTableProperties);
      }

      int rowArrayLength = cellCloneServices.length;
      for (int rows = 0; rows < rowArrayLength; rows++) {
        // set row height
        newTable.getRow(rows).setHeight(
            textTable.getRow(rows).getHeight());
        newTable.getRow(rows).setAutoHeight(
            textTable.getRow(rows).getAutoHeight());

        int columnArrayLength = cellCloneServices[rows].length;
        for (int columns = 0; columns < columnArrayLength; columns++) {
          ICloneService cellClone = cellCloneServices[rows][columns];
          ITextTableCell textTableCell = newTable.getCell(columns,
              rows);
          CloneDestinationPosition destinationCell = new CloneDestinationPosition(
              textTableCell, textTableCell.getClass());
          cellClone.cloneToPositionNoReturn(destinationCell,
              adoptContent, propertyKeysContainer);
        }
      }

      if (createSpace) {
        IParagraph paragraph = textContentService
            .constructNewParagraph();
        textContentService.insertTextContentBefore(paragraph, newTable);
      }
      if (generateReturnValue)
        return new ClonedObject(newTable, newTable.getClass());
      else
        return null;
View Full Code Here

TOP

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

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.