Search in sources :

Example 6 with HeaderAsPropertyRenderer

use of org.apache.jmeter.gui.util.HeaderAsPropertyRenderer 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 7 with HeaderAsPropertyRenderer

use of org.apache.jmeter.gui.util.HeaderAsPropertyRenderer in project jmeter by apache.

the class ProxyControlGui method createExcludePanel.

private JPanel createExcludePanel() {
    excludeModel = new PowerTableModel(new String[] { EXCLUDE_COL }, new Class[] { String.class });
    excludeTable = new JTable(excludeModel);
    JMeterUtils.applyHiDPI(excludeTable);
    excludeTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    excludeTable.setPreferredScrollableViewportSize(new Dimension(80, 80));
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString(// $NON-NLS-1$
    "patterns_to_exclude")));
    panel.add(new JScrollPane(excludeTable), BorderLayout.CENTER);
    panel.add(createTableButtonPanel(ADD_EXCLUDE, DELETE_EXCLUDE, ADD_TO_EXCLUDE_FROM_CLIPBOARD, ADD_SUGGESTED_EXCLUDES), BorderLayout.SOUTH);
    return panel;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) PowerTableModel(org.apache.jmeter.gui.util.PowerTableModel) JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer) Dimension(java.awt.Dimension)

Example 8 with HeaderAsPropertyRenderer

use of org.apache.jmeter.gui.util.HeaderAsPropertyRenderer in project jmeter by apache.

the class HTTPFileArgsPanel method makeMainPanel.

/**
     * Create the main GUI panel which contains the file table.
     *
     * @return the main GUI panel
     */
private Component makeMainPanel() {
    initializeTableModel();
    table = new JTable(tableModel);
    JMeterUtils.applyHiDPI(table);
    table.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    return makeScrollPane(table);
}
Also used : JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer)

Example 9 with HeaderAsPropertyRenderer

use of org.apache.jmeter.gui.util.HeaderAsPropertyRenderer in project jmeter by apache.

the class JMSPropertiesPanel method createPropertiesPanel.

public JPanel createPropertiesPanel() {
    // create the JTable that holds JMSProperty per row
    jmsPropertiesTable = new JTable(tableModel);
    JMeterUtils.applyHiDPI(jmsPropertiesTable);
    jmsPropertiesTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    jmsPropertiesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jmsPropertiesTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
    TableColumn mechanismColumn = jmsPropertiesTable.getColumnModel().getColumn(COL_TYPE);
    mechanismColumn.setCellEditor(new TypeCellEditor());
    JPanel panel = new JPanel(new BorderLayout(0, 5));
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), //$NON-NLS-1$
    JMeterUtils.getResString("jms_props")));
    panel.add(new JScrollPane(jmsPropertiesTable));
    panel.add(createButtonPanel(), BorderLayout.SOUTH);
    return panel;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer) Dimension(java.awt.Dimension) TableColumn(javax.swing.table.TableColumn)

Example 10 with HeaderAsPropertyRenderer

use of org.apache.jmeter.gui.util.HeaderAsPropertyRenderer in project jmeter by apache.

the class ProxyControlGui method createIncludePanel.

private JPanel createIncludePanel() {
    includeModel = new PowerTableModel(new String[] { INCLUDE_COL }, new Class[] { String.class });
    includeTable = new JTable(includeModel);
    JMeterUtils.applyHiDPI(includeTable);
    includeTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    includeTable.setPreferredScrollableViewportSize(new Dimension(80, 80));
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString(// $NON-NLS-1$
    "patterns_to_include")));
    panel.add(new JScrollPane(includeTable), BorderLayout.CENTER);
    panel.add(createTableButtonPanel(ADD_INCLUDE, DELETE_INCLUDE, ADD_TO_INCLUDE_FROM_CLIPBOARD, null), BorderLayout.SOUTH);
    return panel;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) PowerTableModel(org.apache.jmeter.gui.util.PowerTableModel) JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer) Dimension(java.awt.Dimension)

Aggregations

HeaderAsPropertyRenderer (org.apache.jmeter.gui.util.HeaderAsPropertyRenderer)15 JTable (javax.swing.JTable)14 BorderLayout (java.awt.BorderLayout)9 JPanel (javax.swing.JPanel)9 Dimension (java.awt.Dimension)7 JScrollPane (javax.swing.JScrollPane)7 PowerTableModel (org.apache.jmeter.gui.util.PowerTableModel)4 TableColumn (javax.swing.table.TableColumn)3 JSplitPane (javax.swing.JSplitPane)2 TextBoxDoubleClick (org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick)2 JTabbedPane (javax.swing.JTabbedPane)1 JTextPane (javax.swing.JTextPane)1 Style (javax.swing.text.Style)1 StyledDocument (javax.swing.text.StyledDocument)1 TextAreaCellRenderer (org.apache.jmeter.gui.util.TextAreaCellRenderer)1 TextAreaTableCellEditor (org.apache.jmeter.gui.util.TextAreaTableCellEditor)1