Package javax.swing.text

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


                    statsDoc.insertString(
                        statsDoc.getLength(),
                        "HTTP response message: " + responseMsgStr + "\n",
                        null);

          statsDoc.insertString(
            statsDoc.getLength(),
            "\nHTTP response headers:\n" + res.getResponseHeaders() + "\n",
            null);

          // get the text response and image icon
View Full Code Here


            statsBuff.append("Thread Name: ").append(res.getThreadName()).append(NL);
            String startTime = dateFormat.format(new Date(res.getStartTime()));
            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);
            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

     
      doc = m_Parent.m_Output.getStyledDocument();

      try {
        // insert text
        doc.insertString(doc.getLength(), x, doc.getStyle(m_Style));
       
        // move cursor to end
        m_Parent.m_Output.setCaretPosition(doc.getLength());

        // trim size if necessary
View Full Code Here

    public void defaultAction(JTextComponent jTextComponent) {
        try {
            StyledDocument doc = (StyledDocument) jTextComponent.getDocument();
            doc.remove(dotOffset, caretOffset - dotOffset);
            doc.insertString(dotOffset, text, null);
            Completion.get().hideAll();
        } catch (BadLocationException ex) {
            Exceptions.printStackTrace(ex);
        }
    }
View Full Code Here

            Caret caret = target.getCaret();
            int p0 = Math.min(caret.getDot(), caret.getMark());
            int p1 = Math.max(caret.getDot(), caret.getMark());
            doc.remove(p0, p1 - p0);
            int start = caret.getDot();
            doc.insertString(start, getText(), null);
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }
        return true;
View Full Code Here

            } else {
                attrs = getInputAttributes();
            }

            if (content != null) {
                doc.insertString(start, content, attrs);
            }
        } catch (BadLocationException e) {
        }
    }
View Full Code Here

            statsBuff.append("Load time: ").append(res.getTime()).append(NL);
            statsBuff.append("Latency: ").append(res.getLatency()).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

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.