Search in sources :

Example 1 with TextBoxDoubleClick

use of org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick in project jmeter by apache.

the class RequestViewHTTP method createRequestPane.

/**
     * Create a pane with three tables (request, params, headers)
     * 
     * @return Pane to display request data
     */
private Component createRequestPane() {
    // Set up the 1st table Result with empty headers
    tableRequest = new JTable(requestModel);
    JMeterUtils.applyHiDPI(tableRequest);
    // $NON-NLS-1$
    tableRequest.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableRequest.addMouseListener(new TextBoxDoubleClick(tableRequest));
    setFirstColumnPreferredAndMaxWidth(tableRequest);
    RendererUtils.applyRenderers(tableRequest, RENDERERS_REQUEST);
    // Set up the 2nd table 
    tableParams = new JTable(paramsModel);
    JMeterUtils.applyHiDPI(tableParams);
    // $NON-NLS-1$
    tableParams.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableParams.addMouseListener(new TextBoxDoubleClick(tableParams));
    TableColumn column = tableParams.getColumnModel().getColumn(0);
    column.setPreferredWidth(160);
    tableParams.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    RendererUtils.applyRenderers(tableParams, RENDERERS_PARAMS);
    // Set up the 3rd table 
    tableHeaders = new JTable(headersModel);
    JMeterUtils.applyHiDPI(tableHeaders);
    // $NON-NLS-1$
    tableHeaders.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableHeaders.addMouseListener(new TextBoxDoubleClick(tableHeaders));
    setFirstColumnPreferredAndMaxWidth(tableHeaders);
    tableHeaders.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    RendererUtils.applyRenderers(tableHeaders, RENDERERS_HEADERS);
    // Create the split pane
    JSplitPane topSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableParams), GuiUtils.makeScrollPane(tableHeaders));
    topSplit.setOneTouchExpandable(true);
    // set split ratio
    topSplit.setResizeWeight(0.50);
    // see bug jdk 4131528
    topSplit.setBorder(null);
    JSplitPane paneParsed = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableRequest), topSplit);
    paneParsed.setOneTouchExpandable(true);
    // set split ratio (only 5 lines to display)
    paneParsed.setResizeWeight(0.25);
    // see bug jdk 4131528
    paneParsed.setBorder(null);
    // Hint to background color on bottom tabs (grey, not blue)
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(paneParsed);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer) TextBoxDoubleClick(org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick) JSplitPane(javax.swing.JSplitPane) TableColumn(javax.swing.table.TableColumn)

Example 2 with TextBoxDoubleClick

use of org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick in project jmeter by apache.

the class SamplerResultTab method createResponseMetadataPanel.

private Component createResponseMetadataPanel() {
    stats = new JTextPane();
    stats.setEditable(false);
    stats.setBackground(backGround);
    // Add styles to use for different types of status messages
    StyledDocument doc = (StyledDocument) stats.getDocument();
    Style style = doc.addStyle(STYLE_REDIRECT, null);
    StyleConstants.setForeground(style, REDIRECT_COLOR);
    style = doc.addStyle(STYLE_CLIENT_ERROR, null);
    StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);
    style = doc.addStyle(STYLE_SERVER_ERROR, null);
    StyleConstants.setForeground(style, SERVER_ERROR_COLOR);
    paneRaw = GuiUtils.makeScrollPane(stats);
    paneRaw.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    // Set up the 1st table Result with empty headers
    tableResult = new JTable(resultModel);
    JMeterUtils.applyHiDPI(tableResult);
    // $NON-NLS-1$
    tableResult.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableResult.addMouseListener(new TextBoxDoubleClick(tableResult));
    setFirstColumnPreferredSize(tableResult);
    RendererUtils.applyRenderers(tableResult, RENDERERS_RESULT);
    // Set up the 2nd table 
    tableResHeaders = new JTable(resHeadersModel);
    JMeterUtils.applyHiDPI(tableResHeaders);
    // $NON-NLS-1$
    tableResHeaders.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableResHeaders.addMouseListener(new TextBoxDoubleClick(tableResHeaders));
    setFirstColumnPreferredSize(tableResHeaders);
    tableResHeaders.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    RendererUtils.applyRenderers(tableResHeaders, RENDERERS_HEADERS);
    // Set up the 3rd table 
    tableResFields = new JTable(resFieldsModel);
    JMeterUtils.applyHiDPI(tableResFields);
    // $NON-NLS-1$
    tableResFields.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableResFields.addMouseListener(new TextBoxDoubleClick(tableResFields));
    setFirstColumnPreferredSize(tableResFields);
    tableResFields.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    RendererUtils.applyRenderers(tableResFields, RENDERERS_FIELDS);
    // Prepare the Results tabbed pane
    tabbedResult = new JTabbedPane(SwingConstants.BOTTOM);
    // Create the split pane
    JSplitPane topSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableResHeaders), GuiUtils.makeScrollPane(tableResFields));
    topSplit.setOneTouchExpandable(true);
    // set split ratio
    topSplit.setResizeWeight(0.80);
    // see bug jdk 4131528
    topSplit.setBorder(null);
    paneParsed = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableResult), topSplit);
    paneParsed.setOneTouchExpandable(true);
    // set split ratio
    paneParsed.setResizeWeight(0.40);
    // see bug jdk 4131528
    paneParsed.setBorder(null);
    // setup bottom tabs, first Raw, second Parsed
    //$NON-NLS-1$
    tabbedResult.addTab(JMeterUtils.getResString("view_results_table_result_tab_raw"), paneRaw);
    //$NON-NLS-1$
    tabbedResult.addTab(JMeterUtils.getResString("view_results_table_result_tab_parsed"), paneParsed);
    // Hint to background color on bottom tabs (grey, not blue)
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(tabbedResult);
    return panel;
}
Also used : JTextPane(javax.swing.JTextPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer) JTabbedPane(javax.swing.JTabbedPane) StyledDocument(javax.swing.text.StyledDocument) Style(javax.swing.text.Style) TextBoxDoubleClick(org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick) JSplitPane(javax.swing.JSplitPane)

Aggregations

BorderLayout (java.awt.BorderLayout)2 JPanel (javax.swing.JPanel)2 JSplitPane (javax.swing.JSplitPane)2 JTable (javax.swing.JTable)2 HeaderAsPropertyRenderer (org.apache.jmeter.gui.util.HeaderAsPropertyRenderer)2 TextBoxDoubleClick (org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick)2 JTabbedPane (javax.swing.JTabbedPane)1 JTextPane (javax.swing.JTextPane)1 TableColumn (javax.swing.table.TableColumn)1 Style (javax.swing.text.Style)1 StyledDocument (javax.swing.text.StyledDocument)1