Examples of TextDocument


Examples of ag.ion.bion.officelayer.internal.text.TextDocument

        XServiceInfo.class, xComponent);
    if (xServiceInfo.supportsService("com.sun.star.text.TextDocument")) {
      XTextDocument xTextDocument = (XTextDocument) UnoRuntime
          .queryInterface(XTextDocument.class, xComponent);
      if (xTextDocument != null) {
        TextDocument document = new TextDocument(xTextDocument,
            intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.sheet.SpreadsheetDocument")) {
      XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument) UnoRuntime
          .queryInterface(XSpreadsheetDocument.class, xComponent);
      if (xSpreadsheetDocument != null) {
        SpreadsheetDocument document = new SpreadsheetDocument(
            xSpreadsheetDocument, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.presentation.PresentationDocument")) {
      XPresentationSupplier presentationSupplier = (XPresentationSupplier) UnoRuntime
          .queryInterface(XPresentationSupplier.class, xComponent);
      if (presentationSupplier != null) {
        PresentationDocument document = new PresentationDocument(
            presentationSupplier, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.drawing.DrawingDocument")) {
      XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier) UnoRuntime
          .queryInterface(XDrawPagesSupplier.class, xComponent);
      if (xDrawPagesSupplier != null) {
        DrawingDocument document = new DrawingDocument(
            xDrawPagesSupplier, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.formula.FormulaProperties")) {
      XPropertySet xPropertySet = (XPropertySet) UnoRuntime
          .queryInterface(XPropertySet.class, xComponent);
      if (xPropertySet != null) {
        FormulaDocument document = new FormulaDocument(xPropertySet,
            intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.text.WebDocument")) {
      XTextDocument xTextDocument = (XTextDocument) UnoRuntime
          .queryInterface(XTextDocument.class, xComponent);
      if (xTextDocument != null) {
        WebDocument document = new WebDocument(xTextDocument,
            intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.text.GlobalDocument")) {
      XTextDocument xTextDocument = (XTextDocument) UnoRuntime
          .queryInterface(XTextDocument.class, xComponent);
      if (xTextDocument != null) {
        GlobalTextDocument document = new GlobalTextDocument(
            xTextDocument, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.sdb.OfficeDatabaseDocument")) {
      XOfficeDatabaseDocument xOfficeDatabaseDocument = (XOfficeDatabaseDocument) UnoRuntime
          .queryInterface(XOfficeDatabaseDocument.class, xComponent);
      if (xOfficeDatabaseDocument != null) {
        DatabaseDocument document = new DatabaseDocument(
            xOfficeDatabaseDocument, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else {
      return null;
View Full Code Here

Examples of com.couchace.core.api.response.TextDocument

                        // We have what we needed, stop parsing.
                        break;
                    }
                }

                return new TextDocument(documentId, revision, null, json);
            }
        } catch (IOException e) {
            throw new CouchJsonException(e);
        }
    }
View Full Code Here

Examples of com.ibm.richtext.demo.TextDocument

                }
                insText = args[index++].toCharArray();
            }
            else {
                // This will try MConstText first, then plain text.
                TextDocument doc = EditDemo.getDocumentFromFile(new File(args[index++]));
                if (doc == null) {
                    throw new Error("Couldn't open file "+args[index-1]);
                }
                text = doc.getText();
            }
        }
       
        if (index != args.length) {
            throw new Error(USAGE);
View Full Code Here

Examples of de.l3s.boilerpipe.document.TextDocument

    /**
     * getContent returns the boilerpipe extracted text.
     */
    @Override
    public String getContent() {
        TextDocument textDocument = _bpContentHandler.getTextDocument();
        return textDocument.getText(true, false);
    }
View Full Code Here

Examples of de.l3s.boilerpipe.document.TextDocument

    @Override
    public void endDocument() throws SAXException {
        super.endDocument();

        TextDocument td = toTextDocument();
        try {
            extractor.process(td);
        } catch (BoilerpipeProcessingException e) {
            throw new SAXException(e);
        }
       
        Attributes emptyAttrs = new AttributesImpl();

        delegate.startDocument();
        delegate.startPrefixMapping("", XHTMLContentHandler.XHTML);

        delegate.startElement(XHTMLContentHandler.XHTML, "html", "html", emptyAttrs);
        delegate.startElement(XHTMLContentHandler.XHTML, "head", "head", emptyAttrs);
        delegate.startElement(XHTMLContentHandler.XHTML, "title", "title", emptyAttrs);
       
        if (td.getTitle() != null) {
            char[] titleChars = td.getTitle().toCharArray();
            delegate.characters(titleChars, 0, titleChars.length);
            delegate.ignorableWhitespace(NL, 0, NL.length);
        }
       
        delegate.endElement(XHTMLContentHandler.XHTML, "title", "title");
        delegate.endElement(XHTMLContentHandler.XHTML, "head", "head");
       
        delegate.startElement(XHTMLContentHandler.XHTML, "body", "body", emptyAttrs);

        for (TextBlock block : td.getTextBlocks()) {
            if (block.isContent()) {
                delegate.startElement(XHTMLContentHandler.XHTML, "p", "p", emptyAttrs);
                char[] chars = block.getText().toCharArray();
                delegate.characters(chars, 0, chars.length);
                delegate.endElement(XHTMLContentHandler.XHTML, "p", "p");
View Full Code Here

Examples of de.l3s.boilerpipe.document.TextDocument

                if(cache.contains(url.toString())){
                    text = cache.get(url.toString());
                    logger.debug("  Fetched from cache:"+url.toString());
                } else {
                    HTMLDocument htmlDoc = HTMLFetcher.fetch(url);
                    TextDocument doc = new BoilerpipeSAXInput(htmlDoc.toInputSource()).getTextDocument();
                    text = ArticleExtractor.INSTANCE.getText(doc);
                    cache.put(url.toString(), text);
                    logger.debug("Fetched from web:"+url.toString());
                }
                if(text.length()<100){
View Full Code Here

Examples of org.apache.lucene.ant.TextDocument

   
    TextDocument doc;
   
    @Override
    public void setUp() throws IOException {
        doc = new TextDocument(getFile("test.txt"));
    }
View Full Code Here

Examples of org.jitterbit.integration.data.entity.TextDocument

    private StructureEditor textStructureEditor(SourceTarget st) {
        TextDocumentId id = (st == SourceTarget.Source) ? transformation.getSourceTextDocumentId()
                        : transformation.getTargetTextDocumentId();
        IntegrationProject project = ProjectUtils.getProject(transformation);
        TextDocument doc = project.getItemLookup().getEntity(id, TextDocument.class);
        return new TextStructureEditor(doc, st, explorerSupport);
    }
View Full Code Here

Examples of org.odftoolkit.simple.TextDocument

  }

  @Test
  public void testReturnChar() {
    try {
      TextDocument textDoc = TextDocument.newTextDocument();
      textDoc.newParagraph();
      OdfTextParagraph graph = textDoc.newParagraph("abc");

      TextExtractor extractor = TextExtractor.newOdfTextExtractor(textDoc.getContentRoot());
      String text = extractor.getText();
      System.out.println(text);

      int count = 0;
      for (int i = 0; i < text.length(); i++)
View Full Code Here

Examples of org.odftoolkit.simple.TextDocument

   * "simpleODF should be Simple ODF" for all the 'simpleODF' word
   */
  @Test
  public void testAddComment() {
    try {
      TextDocument textDoc = TextDocument.loadDocument(ResourceUtilities.getAbsolutePath(TEXT_COMMENT_FILE));
      search = new TextNavigation("simpleODF", textDoc);
      int i=0;
      while (search.hasNext()) {
        TextSelection item = (TextSelection) search.nextSelection();
        item.addComment("simpleODF should be replaced by Simple ODF.", "devin-"+i);
        i++;
      }
      // there are 7 simpleODF in this test document.
      Assert.assertEquals(7, i);
      textDoc.save(ResourceUtilities.newTestOutputFile(SAVE_FILE_COMMENT));
    } catch (Exception e) {
      Logger.getLogger(TextSelectionTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
      Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
    }
  }
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.