Package javax.swing.text

Examples of javax.swing.text.DefaultStyledDocument$ChangeDesc


          try {
              reader = new InputStreamReader(is);
              file = File.createTempFile("extract", ".tmp");
              tempFiles.markForDeletion(file);
              writer = new FileWriter(file);
              DefaultStyledDocument doc = new DefaultStyledDocument();
              new RTFEditorKit().read(reader, doc, 0);
              writer.write(doc.getText(0, doc.getLength()));
          } catch (Exception ioe) {
              throw new ExtractionException("failed to parse rtf document", ioe,logger);
          }
          finally {
              if (reader != null) {
View Full Code Here


          try {
              reader = new InputStreamReader(is);
              file = File.createTempFile("extract", ".tmp");
              tempFiles.markForDeletion(file);
              writer = new FileWriter(file);
              DefaultStyledDocument doc = new DefaultStyledDocument();
              new RTFEditorKit().read(reader, doc, 0);
              writer.write(doc.getText(0, doc.getLength()));
          } catch (Exception ioe) {
              throw new ExtractionException("failed to parse rtf document", ioe,logger);
          }
          finally {
              if (reader != null) {
View Full Code Here

          try {
              reader = new InputStreamReader(is);
              file = File.createTempFile("extract", ".tmp");
              tempFiles.markForDeletion(file);
              writer = new FileWriter(file);
              DefaultStyledDocument doc = new DefaultStyledDocument();
              new RTFEditorKit().read(reader, doc, 0);
              writer.write(doc.getText(0, doc.getLength()));
          } catch (Exception ioe) {
              throw new ExtractionException("failed to parse rtf document", ioe,logger);
          }
          finally {
              if (reader != null) {
View Full Code Here

          try {
              reader = new InputStreamReader(is);
              file = File.createTempFile("extract_rtf", ".tmp");
              indexInfo.addDeleteFile(file);
              writer = new FileWriter(file);
              DefaultStyledDocument doc = new DefaultStyledDocument();
              new RTFEditorKit().read(reader, doc, 0);
              writer.write(doc.getText(0, doc.getLength()));
          } catch (Throwable ioe) {
              throw new ExtractionException("failed to parse rtf document", ioe,logger);
          } finally {
              if (reader != null) {
                  try {
View Full Code Here

    public String getContent( Part part) throws IOException, MessagingException
    {
        LOG.debug("parsing RTF document");
       
        String bodyText = "";
        DefaultStyledDocument styledDoc = new DefaultStyledDocument();
        try
        {
            new RTFEditorKit().read(part.getInputStream(), styledDoc, 0);
            bodyText = styledDoc.getText(0, styledDoc.getLength());
        }
        catch( BadLocationException e)
        {
            LOG.debug("Cannot extract text from a RTF document", e);
        }
View Full Code Here

    public Document[] parse(final MultiProtocolURI location, final String mimeType,
            final String charset, final InputStream source)
            throws Parser.Failure, InterruptedException {

        try
            final DefaultStyledDocument doc = new DefaultStyledDocument();
           
            final RTFEditorKit theRtfEditorKit = new RTFEditorKit();              
            theRtfEditorKit.read(source, doc, 0);           
           
            final String bodyText = doc.getText(0, doc.getLength());
           
            return new Document[]{new Document(
                    location,
                    mimeType,
                    "UTF-8",
View Full Code Here

   * Creates the annotation display.
   */
  private void displayAnnotations() {
    // for speed, detach document from text pane before updating
    StyledDocument doc = (StyledDocument) textPane.getDocument();
    Document blank = new DefaultStyledDocument();
    textPane.setDocument(blank);

    // make sure annotationCheckboxPanel is showing
    if (legendScrollPane.getViewport().getView() != annotationCheckboxPanel) {
      legendScrollPane.setViewportView(annotationCheckboxPanel);
View Full Code Here

   * Creates the entity display.
   */
  private void displayEntities() {
    // for speed, detach document from text pane before updating
    StyledDocument doc = (StyledDocument) textPane.getDocument();
    Document blank = new DefaultStyledDocument();
    textPane.setDocument(blank);

    // make sure entityCheckboxPanel is showing
    if (legendScrollPane.getViewport().getView() != entityCheckboxPanel) {
      legendScrollPane.setViewportView(entityCheckboxPanel);
View Full Code Here

        if (dstTextPane != null)
            dstTextPane.setText("");
    }
   
    private void createDocuments() {
        combinedDoc = new DefaultStyledDocument();
        srcDoc = new DefaultStyledDocument();
        dstDoc = new DefaultStyledDocument();
        Iterator it = edits.iterator();
        int srcLast = 0;
        int dstLast = 0;
        try {
            while (it.hasNext()) {
View Full Code Here

    listPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory
        .createTitledBorder(" System Logger "), BorderFactory
        .createEmptyBorder(1, 1, 1, 1)));

    styleDoc = new DefaultStyledDocument();
    listTextArea = new JTextPane(styleDoc);
    listTextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
    listTextArea.setOpaque(true);
    listTextArea.setEditable(false);
    listTextArea.setBackground(Color.BLACK);
View Full Code Here

TOP

Related Classes of javax.swing.text.DefaultStyledDocument$ChangeDesc

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.