Package ag.ion.bion.officelayer.internal.application

Examples of ag.ion.bion.officelayer.internal.application.LocalOfficeApplication


*/
public class IPageStylePropertiesTest extends TestCase {

  public void testGetIsLandscape() {
    try {
      LocalOfficeApplication localOfficeApplication = new LocalOfficeApplication(
          null);
      LocalOfficeApplicationConfiguration configuration = new LocalOfficeApplicationConfiguration();
      configuration
          .setApplicationHomePath("c:\\Programme\\OpenOffice.org1.1.3");
      localOfficeApplication.setConfiguration(configuration);
      localOfficeApplication.activate();

      ITextDocument textDocument = (ITextDocument) localOfficeApplication
          .getDocumentService().constructNewDocument(
              IDocument.WRITER, new DocumentDescriptor());
      IPageService pageService = textDocument.getPageService();
      IPage page = pageService.getPage(0);
      IPageStyle pageStyle = page.getPageStyle();
      IPageStyleProperties pageStyleProperties = pageStyle
          .getProperties();
      boolean value = pageStyleProperties.getIsLandscape();
      Assert.assertEquals(false, value);

      ITextTable textTable = textDocument.getTextTableService()
          .constructTextTable(5, 15);
      textDocument.getTextService().getTextContentService()
          .insertTextContent(textTable);
      page = pageService.getPage(0);
      pageStyle = page.getPageStyle();
      pageStyleProperties = pageStyle.getProperties();
      value = pageStyleProperties.getIsLandscape();
      Assert.assertEquals(false, value);

      localOfficeApplication.deactivate();
    } catch (Exception exception) {
      exception.printStackTrace();
      Assert.fail();
    }
  }
View Full Code Here


   * Basic test class
   *
   */
  public void testGetParagraphText() {
    try {
      LocalOfficeApplication localOfficeApplication = new LocalOfficeApplication(
          null);
      LocalOfficeApplicationConfiguration configuration = new LocalOfficeApplicationConfiguration();
      configuration
          .setApplicationHomePath("/home/Sebastianr/OpenOffice.org1.1.1");
      localOfficeApplication.setConfiguration(configuration);
      localOfficeApplication.activate();

      IDocument document = localOfficeApplication
          .getDocumentService()
          .loadDocument(
              new FileInputStream(new File("test/testTexts.sxw")),
              new DocumentDescriptor());
      if (document != null) {
        System.out.println("Loaded document");

        ITextDocument textDocument = (ITextDocument) document;

        ITextContentEnumeration textEnumeration = textDocument
            .getTextService().getText().getTextContentEnumeration();
        IParagraph[] paragraphs = textEnumeration.getParagraphs();

        ITextRange newTextRange = textDocument.getViewCursorService()
            .getViewCursor().getStartTextRange();
        XTextCursor cursor = newTextRange.getXTextRange().getText()
            .createTextCursor();
        cursor.gotoEnd(false);
        newTextRange = new TextRange(textDocument, cursor);
        paragraphs[0].getCloneService().cloneToPosition(
            new CloneDestinationPosition(newTextRange, newTextRange
                .getClass()), true, null);

        textDocument.close();
        localOfficeApplication.deactivate();
      }
    } catch (Exception excep) {
      excep.printStackTrace();
    }
  }
View Full Code Here

    // }
  }

  public void testCellWidths() {
    try {
      LocalOfficeApplication localOfficeApplication = new LocalOfficeApplication(
          null);
      LocalOfficeApplicationConfiguration configuration = new LocalOfficeApplicationConfiguration();
      configuration
          .setApplicationHomePath("d:\\Programme\\OpenOffice.org1.1.3");
      localOfficeApplication.setConfiguration(configuration);
      localOfficeApplication.activate();
      ITextDocument textDocument = (ITextDocument) localOfficeApplication
          .getDocumentService().constructNewDocument(
              IDocument.WRITER, new DocumentDescriptor());

      ITextTable textTable = textDocument.getTextTableService()
          .constructTextTable(5, 15);
View Full Code Here

   * @author Andreas Br�ker
   *
   * @deprecated Use getApplication(...) instead.
   */
  public static IOfficeApplication getLocalOfficeApplication() {
    return new LocalOfficeApplication(null);
  }
View Full Code Here

    Object type = configuration.get(IOfficeApplication.APPLICATION_TYPE_KEY);
    if(type == null)
      throw new OfficeApplicationException("The application type is missing.");
   
    if(type.toString().equals(IOfficeApplication.LOCAL_APPLICATION)) {
      return new LocalOfficeApplication(configuration);
    }
    else
      return new RemoteOfficeApplication(configuration);   
  }
View Full Code Here

   * @author Andreas Br�ker
   *
   * @deprecated Use getApplication(...) instead.
   */
  public static IOfficeApplication getLocalOfficeApplication() {
    return new LocalOfficeApplication(null);
  }
View Full Code Here

    if (type == null)
      throw new OfficeApplicationException(
          "The application type is missing.");

    if (type.toString().equals(IOfficeApplication.LOCAL_APPLICATION)) {
      return new LocalOfficeApplication(configuration);
    } else
      return new RemoteOfficeApplication(configuration);
  }
View Full Code Here

*/
public class IPageStylePropertiesTest extends TestCase {

  public void testGetIsLandscape() {
    try {
      LocalOfficeApplication localOfficeApplication = new LocalOfficeApplication(null);
      LocalOfficeApplicationConfiguration configuration = new LocalOfficeApplicationConfiguration();
      configuration.setApplicationHomePath("c:\\Programme\\OpenOffice.org1.1.3");
      localOfficeApplication.setConfiguration(configuration);
      localOfficeApplication.activate();
     
      ITextDocument textDocument = (ITextDocument)localOfficeApplication.getDocumentService().constructNewDocument(IDocument.WRITER, new DocumentDescriptor());
      IPageService pageService = textDocument.getPageService();
      IPage page = pageService.getPage(0);
      IPageStyle pageStyle = page.getPageStyle();
      IPageStyleProperties pageStyleProperties = pageStyle.getProperties();
      boolean value = pageStyleProperties.getIsLandscape();
      Assert.assertEquals(false, value);
     
      ITextTable textTable = textDocument.getTextTableService().constructTextTable(5, 15);
      textDocument.getTextService().getTextContentService().insertTextContent(textTable);
      page = pageService.getPage(0);
      pageStyle = page.getPageStyle();
      pageStyleProperties = pageStyle.getProperties();
      value = pageStyleProperties.getIsLandscape();
      Assert.assertEquals(false, value);
     
      localOfficeApplication.deactivate();
    }
    catch(Exception exception) {
      exception.printStackTrace();
      Assert.fail();
    }   
View Full Code Here

   * Basic test class
   *
   */
  public void testGetParagraphText() {
    try {
      LocalOfficeApplication localOfficeApplication = new LocalOfficeApplication(null);
      LocalOfficeApplicationConfiguration configuration = new LocalOfficeApplicationConfiguration();
      configuration.setApplicationHomePath("/home/Sebastianr/OpenOffice.org1.1.1");
      localOfficeApplication.setConfiguration(configuration);
      localOfficeApplication.activate();
     
      IDocument document = localOfficeApplication.getDocumentService().loadDocument(new FileInputStream(new File("test/testTexts.sxw")), new DocumentDescriptor());
      if (document != null) {
        System.out.println("Loaded document");
       
        ITextDocument textDocument = (ITextDocument)document;
             
       
        ITextContentEnumeration textEnumeration = textDocument.getTextService().getText().getTextContentEnumeration();
        IParagraph[] paragraphs = textEnumeration.getParagraphs();
       
       
        ITextRange newTextRange = textDocument.getViewCursorService().getViewCursor().getStartTextRange();
        XTextCursor cursor = newTextRange.getXTextRange().getText().createTextCursor();
        cursor.gotoEnd(false);
        newTextRange = new TextRange(textDocument, cursor);
        paragraphs[0].getCloneService().cloneToPosition(new CloneDestinationPosition(newTextRange, newTextRange.getClass()), true, null);
               
        textDocument.close();
        localOfficeApplication.deactivate();
      }
    }
    catch (Exception excep) {
      excep.printStackTrace();
    }
View Full Code Here

//    }   
  }
 
  public void testCellWidths() {
   try {    
      LocalOfficeApplication localOfficeApplication = new LocalOfficeApplication(null);
      LocalOfficeApplicationConfiguration configuration = new LocalOfficeApplicationConfiguration();
      configuration.setApplicationHomePath("d:\\Programme\\OpenOffice.org1.1.3");
      localOfficeApplication.setConfiguration(configuration);
      localOfficeApplication.activate();
      ITextDocument textDocument = (ITextDocument)localOfficeApplication.getDocumentService().constructNewDocument(IDocument.WRITER, new DocumentDescriptor());
     
      ITextTable textTable = textDocument.getTextTableService().constructTextTable(5, 15);
      textDocument.getTextService().getTextContentService().insertTextContent(textTable);
     
      ITextTableProperties tableProperties = textTable.getProperties();
View Full Code Here

TOP

Related Classes of ag.ion.bion.officelayer.internal.application.LocalOfficeApplication

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.