Package javax.swing.text

Examples of javax.swing.text.StyledDocument.insertString()


    }

    // add text from CAS
    try {
      doc.remove(0, doc.getLength());
      doc.insertString(0, mCAS.getDocumentText(), new SimpleAttributeSet());
    } catch (BadLocationException e) {
      throw new RuntimeException(e);
    }

    // Iterate over EntityAnnotations using JCAS, because the EntityResolver interface
View Full Code Here


        StyledDocument doc = (StyledDocument) pane.getDocument();
        StyledEditorKit kit = (StyledEditorKit) pane.getEditorKit();
        try {
            MutableAttributeSet attrs = new SimpleAttributeSet();
            StyleConstants.setUnderline(attrs, true);
            doc.insertString(0, "Hello word!", attrs);
            pane.setCaretPosition(4);
            attrs = new SimpleAttributeSet();
            StyleConstants.setIcon(attrs, MetalIconFactory.getTreeFolderIcon());
            doc.insertString(4, " ", attrs);
            pane.setCaretPosition(4);
View Full Code Here

            StyleConstants.setUnderline(attrs, true);
            doc.insertString(0, "Hello word!", attrs);
            pane.setCaretPosition(4);
            attrs = new SimpleAttributeSet();
            StyleConstants.setIcon(attrs, MetalIconFactory.getTreeFolderIcon());
            doc.insertString(4, " ", attrs);
            pane.setCaretPosition(4);
            doc.insertString(4, "\n", kit.getInputAttributes());
            assertFalse(StyleConstants.isUnderline(kit.getInputAttributes()));
            pane.setCaretPosition(5);
            assertFalse(StyleConstants.isUnderline(kit.getInputAttributes()));
View Full Code Here

    public void testReplaceSelection_AtTheBeginningOfParagraph() {
        StyledDocument doc = textPane.getStyledDocument();
        try {
            attrs = new SimpleAttributeSet();
            StyleConstants.setUnderline(attrs, true);
            doc.insertString(0, "Hello word!", attrs);
            textPane.setCaretPosition(4);
            textPane.insertIcon(MetalIconFactory.getTreeFolderIcon());
            textPane.setCaretPosition(4);
            textPane.replaceSelection("\n");
            textPane.setCaretPosition(5);
View Full Code Here

            statsBuff.append("Sample Start: ").append(startTime).append(NL);
            statsBuff.append("Load time: ").append(res.getTime()).append(NL);
            statsBuff.append("Size in bytes: ").append(res.getBytes()).append(NL);
            statsBuff.append("Sample Count: ").append(res.getSampleCount()).append(NL);
            statsBuff.append("Error Count: ").append(res.getErrorCount()).append(NL);
            statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), null);
            statsBuff = new StringBuffer(); //reset for reuse
           
            String responseCode = res.getResponseCode();
            log.debug("valueChanged1 : response code - " + responseCode);
View Full Code Here

              style = statsDoc.getStyle(STYLE_SERVER_ERROR);
              break;
            }

            statsBuff.append("Response code: ").append(responseCode).append(NL);
            statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), style);
            statsBuff = new StringBuffer(100); //reset for reuse

            // response message label
            String responseMsgStr = res.getResponseMessage();
View Full Code Here

            log.debug("valueChanged1 : response message - " + responseMsgStr);
            statsBuff.append("Response message: ").append(responseMsgStr).append(NL);

            statsBuff.append(NL).append("Response headers:").append(NL);
            statsBuff.append(res.getResponseHeaders()).append(NL);
            statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), null);
            statsBuff = null; // Done

            // get the text response and image icon
            // to determine which is NOT null
            if ((SampleResult.TEXT).equals(res.getDataType())) // equals(null) is OK
View Full Code Here

          if (res != null) {
            StringBuffer statsBuff = new StringBuffer(100);
            statsBuff.append("Assertion error: ").append(res.isError()).append(NL);
            statsBuff.append("Assertion failure: ").append(res.isFailure()).append(NL);
            statsBuff.append("Assertion failure message : ").append(res.getFailureMessage()).append(NL);
            statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), null);
            statsBuff = null;
          }
        }
      }
    } catch (BadLocationException exc) {
View Full Code Here

                statsBuff.append(JMeterUtils.getResString("view_results_size_in_bytes")).append(sampleResult.getBytes()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_size_headers_in_bytes")).append(sampleResult.getHeadersSize()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_size_body_in_bytes")).append(sampleResult.getBodySize()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_sample_count")).append(sampleResult.getSampleCount()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_error_count")).append(sampleResult.getErrorCount()).append(NL); //$NON-NLS-1$
                statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), null);
                statsBuff.setLength(0); // reset for reuse

                String responseCode = sampleResult.getResponseCode();

                int responseLevel = 0;
View Full Code Here

                default: // quieten Findbugs
                    break; // default - do nothing
                }

                statsBuff.append(JMeterUtils.getResString("view_results_response_code")).append(responseCode).append(NL); //$NON-NLS-1$
                statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), style);
                statsBuff.setLength(0); // reset for reuse

                // response message label
                String responseMsgStr = sampleResult.getResponseMessage();
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.