Package javax.swing.text

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


                StringBuilder statsBuff = new StringBuilder(100);
                statsBuff.append(JMeterUtils.getResString("view_results_assertion_error")).append(assertionResult.isError()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_assertion_failure")).append(assertionResult.isFailure()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_assertion_failure_message")).append(assertionResult.getFailureMessage()).append(NL); //$NON-NLS-1$
                statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), null);
            }
        } catch (BadLocationException exc) {
            stats.setText(exc.getLocalizedMessage());
        }
    }
View Full Code Here


        }
    }

    public void testTranslateHTMLToCSSStyledDocument() throws Exception {
        StyledDocument doc = new DefaultStyledDocument();
        doc.insertString(0, "line1\nline2", null);

        MutableAttributeSet mas = new SimpleAttributeSet();
        mas.addAttribute(HTML.Attribute.BGCOLOR, "#ffffff");
        mas.addAttribute(HTML.Attribute.TEXT, "black");
        doc.setParagraphAttributes(0, 1, mas, false);
View Full Code Here

        assertNotSame(paragraph.getAttributes(), view.getAttributes());
    }

    public void testInlineViewUponStyledDocument() throws BadLocationException {
        final StyledDocument styledDoc = new DefaultStyledDocument();
        styledDoc.insertString(0, "a simple paragraph", null);
        inline = styledDoc.getCharacterElement(1);
        testExceptionalCase(new ClassCastCase() {
            public void exceptionalAction() throws Exception {
                new InlineView(inline);
            }
View Full Code Here

                statsBuff.append(JMeterUtils.getResString("view_results_load_time")).append(sampleResult.getTime()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_latency")).append(sampleResult.getLatency()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_size_in_bytes")).append(sampleResult.getBytes()).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

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

                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

                statsBuff.append(sampleResult.getResponseHeaders()).append(NL);
                statsBuff.append(NL);
                statsBuff.append(typeResult + " "+ JMeterUtils.getResString("view_results_fields")).append(NL); //$NON-NLS-1$ $NON-NLS-2$
                statsBuff.append("ContentType: ").append(sampleResult.getContentType()).append(NL); //$NON-NLS-1$
                statsBuff.append("DataEncoding: ").append(sampleResult.getDataEncodingNoDefault()).append(NL); //$NON-NLS-1$
                statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), null);
                statsBuff = null; // Done
               
                // Tabbed results     
                resultModel.clearData(); // clear results table before filling
                // fill table
View Full Code Here

                StringBuilder statsBuff = new StringBuilder(100);
                statsBuff.append(JMeterUtils.getResString("view_results_assertion_error")).append(assertionResult.isError()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_assertion_failure")).append(assertionResult.isFailure()).append(NL); //$NON-NLS-1$
                statsBuff.append(JMeterUtils.getResString("view_results_assertion_failure_message")).append(assertionResult.getFailureMessage()).append(NL); //$NON-NLS-1$
                statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), null);
            }
        } catch (BadLocationException exc) {
            stats.setText(exc.getLocalizedMessage());
        }
    }
View Full Code Here

                    statsBuff.append(JMeterUtils.getResString("view_results_load_time")).append(res.getTime()).append(NL); //$NON-NLS-1$
                    statsBuff.append(JMeterUtils.getResString("view_results_latency")).append(res.getLatency()).append(NL); //$NON-NLS-1$
                    statsBuff.append(JMeterUtils.getResString("view_results_size_in_bytes")).append(res.getBytes()).append(NL); //$NON-NLS-1$
                    statsBuff.append(JMeterUtils.getResString("view_results_sample_count")).append(res.getSampleCount()).append(NL); //$NON-NLS-1$
                    statsBuff.append(JMeterUtils.getResString("view_results_error_count")).append(res.getErrorCount()).append(NL); //$NON-NLS-1$
                    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(JMeterUtils.getResString("view_results_response_code")).append(responseCode).append(NL); //$NON-NLS-1$
                    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

                    statsBuff.append(NL);
                    final String samplerClass = res.getClass().getName();
                    statsBuff.append(samplerClass.substring(1+samplerClass.lastIndexOf('.'))).append(" " + JMeterUtils.getResString("view_results_fields")).append(NL); //$NON-NLS-1$
                    statsBuff.append("ContentType: ").append(res.getContentType()).append(NL);
                    statsBuff.append("DataEncoding: ").append(res.getDataEncodingNoDefault()).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

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.