Package ag.ion.bion.officelayer.text

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


        paraAdjust == IParagraphProperties.ALIGN_UNDEFINED
        ) {
      this.paraAdjust = paraAdjust; 
    }
    else {
      throw new TextException("The paraAdjust is not valid");
    }
  }
View Full Code Here


   * @author Andreas Br�ker
   */
  public IParagraph constructNewParagraph() throws TextException {
    try {
      if(xMultiServiceFactory == null)
        throw new TextException("OpenOffice.org XMultiServiceFactory inteface not valid.");
      Object object = xMultiServiceFactory.createInstance("com.sun.star.text.Paragraph");
      XTextContent xTextContent = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, object);
     
      return new Paragraph(textDocument, xTextContent);
    }
    catch(Exception exception) {
      TextException textException = new TextException(exception.getMessage());
      textException.initCause(exception);
      throw textException;
    }
  }
View Full Code Here

   * @date 09.07.2007
   */
  public ITextDocumentImage constructNewImage(GraphicInfo graphicInfo) throws TextException {
    try {
      if(xMultiServiceFactory == null)
        throw new TextException("OpenOffice.org XMultiServiceFactory inteface not valid.");

      if(xBitmapContainer == null)
        xBitmapContainer = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class,
            xMultiServiceFactory.createInstance("com.sun.star.drawing.BitmapTable"));

      XTextContent xImage = (XTextContent)UnoRuntime.queryInterface(XTextContent.class,
          xMultiServiceFactory.createInstance("com.sun.star.text.TextGraphicObject"));
     
      XPropertySet xProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xImage);

      String tempId = "tempImageId"+System.currentTimeMillis();
      xBitmapContainer.insertByName(tempId, graphicInfo.getUrl());
      String internalURL = AnyConverter.toString(xBitmapContainer.getByName(tempId));

      xProps.setPropertyValue("AnchorType", graphicInfo.getAnchor());
      xProps.setPropertyValue("GraphicURL", internalURL);
      xProps.setPropertyValue("Width", Integer.valueOf(graphicInfo.getWidth()));
      xProps.setPropertyValue("Height", Integer.valueOf(graphicInfo.getHeight()));
      xProps.setPropertyValue("HoriOrient", Short.valueOf(graphicInfo.getHorizontalAlignment()));
      xProps.setPropertyValue("VertOrient", Short.valueOf(graphicInfo.getVerticalAlignment()));   
     
      ITextDocumentImage textDocumentImage = new TextDocumentImage(textDocument, xImage, graphicInfo);
     
      if(imageToImageIds == null)
        imageToImageIds = new HashMap<ITextDocumentImage,String>();
      imageToImageIds.put(textDocumentImage, tempId);
     
      return textDocumentImage;
    }
    catch(Exception exception) {
      TextException textException = new TextException(exception.getMessage());
      textException.initCause(exception);
      throw textException;
    }
  } 
View Full Code Here

        }
        ((ITextDocumentImage)textContent).getGraphicInfo().cleanUp();
      }
    }
    catch(Exception exception) {
      TextException textException = new TextException(exception.getMessage());
      textException.initCause(exception);
      throw textException;
    }
  }
View Full Code Here

  public void removeTextContent(ITextContent textContent) throws TextException {
    try {    
      xText.removeTextContent(textContent.getXTextContent());
    }
    catch(Exception exception) {
      TextException textException = new TextException(exception.getMessage());
      textException.initCause(exception);
      throw textException;
    }
  }
View Full Code Here

          ((ITextDocumentImage)textContent).getGraphicInfo().cleanUp();
        }
      }
    }
    catch(Exception exception) {
      TextException textException = new TextException(exception.getMessage());
      textException.initCause(exception);
      throw textException;
    }   
  }
View Full Code Here

          ((ITextDocumentImage)textContent).getGraphicInfo().cleanUp();
        }
      }
    }
    catch(Exception exception) {
      TextException textException = new TextException(exception.getMessage());
      textException.initCause(exception);
      throw textException;
    }   
  }
View Full Code Here

          ((ITextDocumentImage)textContent).getGraphicInfo().cleanUp();
        }
      }
    }
    catch(Exception exception) {
      TextException textException = new TextException(exception.getMessage());
      textException.initCause(exception);
      throw textException;
    }
  }
View Full Code Here

      rowNumber++;
      try {
        this.textTableCells = (IETextTableCell[])ArrayUtils.appendArray(this.textTableCells,textTableCells,IETextTableCell.class);
      }
      catch(Exception exception) {
        TextException textException = new TextException("The submitted type is not valid");
        textException.initCause(exception);
        throw textException;
      }
    }
    textTableCellProperties = new ITextTableCellProperties[textTableCellRange.length];
    for(int i = 0; i < textTableCellProperties.length; i++) {
View Full Code Here

   *
   * @author Andreas Br�ker
   */
  public ITextTable constructTextTable(int rows, int columns) throws TextException {
    if(columns > ITextTable.MAX_COLUMNS_IN_TABLE) {
      throw new TextException("The submitted table is not valid");
    }
    try {
      XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, textDocument.getXTextDocument());
      Object newTable = xMultiServiceFactory.createInstance("com.sun.star.text.TextTable");
      XTextTable newTextTable = (XTextTable)UnoRuntime.queryInterface(XTextTable.class, newTable);
      newTextTable.initialize(rows,columns);
     
      TextTable textTable = new TextTable(textDocument, newTextTable);
      return textTable;
    }
    catch(Exception exception) {
      TextException textException = new TextException(exception.getMessage());
      textException.initCause(exception);
      throw textException;
    }
  }
View Full Code Here

TOP

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

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.