public HorizontalPanel(int hgap, float verticalAlign) { super(new BorderLayout()); add(subPanel, BorderLayout.CENTER); this.hgap = hgap; this.verticalAlign = verticalAlign; }
protected JPanel createLabelsPanel() { HorizontalPanel panel = new HorizontalPanel(); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"Labels")); this.codeCheckBox = new JCheckBox("Code"); panel.add(this.codeCheckBox); this.labelsCheckBox = new JCheckBox("Jmeter Labels"); panel.add(this.labelsCheckBox); this.successCheckBox = new JCheckBox("Success"); panel.add(this.successCheckBox); return panel; }
private JPanel createPortPanel() { portField = new JTextField(HttpSimpleTableControl.DEFAULT_PORT_S, 8); portField.setName(HttpSimpleTableControl.PORT); JLabel label = new JLabel(JMeterUtils.getResString("port")); label.setLabelFor(portField); datasetDirectoryField = new JTextField( HttpSimpleTableControl.DEFAULT_DATA_DIR, 8); datasetDirectoryField.setName(HttpSimpleTableControl.DATA_DIR); JLabel ddLabel = new JLabel("Dataset directory:"); ddLabel.setLabelFor(datasetDirectoryField); timestampChkBox = new JCheckBox(); timestampChkBox.setSelected(HttpSimpleTableControl.DEFAULT_TIMESTAMP); timestampChkBox.setName(HttpSimpleTableControl.TIMESTAMP); JLabel tsLabel = new JLabel("Timestamp:"); tsLabel.setLabelFor(timestampChkBox); HorizontalPanel panel = new HorizontalPanel(); panel.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Settings")); panel.add(label); panel.add(portField); panel.add(ddLabel); panel.add(datasetDirectoryField); panel.add(tsLabel); panel.add(timestampChkBox); panel.add(Box.createHorizontalStrut(10)); return panel; }
private JPanel createPortPanel() { portField = new JTextField(HttpSimpleTableControl.DEFAULT_PORT_S, 8); portField.setName(HttpSimpleTableControl.PORT); JLabel label = new JLabel(JMeterUtils.getResString("port")); label.setLabelFor(portField); datasetDirectoryField = new JTextField( HttpSimpleTableControl.DEFAULT_DATA_DIR, 8); datasetDirectoryField.setName(HttpSimpleTableControl.DATA_DIR); JLabel ddLabel = new JLabel("Dataset directory:"); ddLabel.setLabelFor(datasetDirectoryField); timestampChkBox = new JCheckBox(); timestampChkBox.setSelected(HttpSimpleTableControl.DEFAULT_TIMESTAMP); timestampChkBox.setName(HttpSimpleTableControl.TIMESTAMP); JLabel tsLabel = new JLabel("Timestamp:"); tsLabel.setLabelFor(timestampChkBox); HorizontalPanel panel = new HorizontalPanel(); panel.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Settings")); panel.add(label); panel.add(portField); panel.add(ddLabel); panel.add(datasetDirectoryField); panel.add(tsLabel); panel.add(timestampChkBox); panel.add(Box.createHorizontalStrut(10)); return panel; }
private JPanel createPortPanel() { portField = new JTextField(HttpMirrorControl.DEFAULT_PORT_S, 8); portField.setName(HttpMirrorControl.PORT); JLabel label = new JLabel(JMeterUtils.getResString("port")); // $NON-NLS-1$ label.setLabelFor(portField); maxPoolSizeField = new JTextField(Integer.toString(HttpMirrorControl.DEFAULT_MAX_POOL_SIZE), 8); maxPoolSizeField.setName(HttpMirrorControl.MAX_POOL_SIZE); JLabel mpsLabel = new JLabel(JMeterUtils.getResString("httpmirror_max_pool_size")); // $NON-NLS-1$ mpsLabel.setLabelFor(maxPoolSizeField); maxQueueSizeField = new JTextField(Integer.toString(HttpMirrorControl.DEFAULT_MAX_QUEUE_SIZE), 8); maxQueueSizeField.setName(HttpMirrorControl.MAX_QUEUE_SIZE); JLabel mqsLabel = new JLabel(JMeterUtils.getResString("httpmirror_max_queue_size")); // $NON-NLS-1$ mqsLabel.setLabelFor(maxQueueSizeField); HorizontalPanel panel = new HorizontalPanel(); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("httpmirror_settings"))); // $NON-NLS-1$ panel.add(label); panel.add(portField); panel.add(mpsLabel); panel.add(maxPoolSizeField); panel.add(mqsLabel); panel.add(maxQueueSizeField); panel.add(Box.createHorizontalStrut(10)); return panel; }
/** * Create the panel that holds all the server configuration (ports, config files etc.) * * @return - the server configuration panel */ protected JPanel createServerPanel(){ HorizontalPanel panel = new HorizontalPanel(); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"Server")); panel.add(this.createPortPanel()); return panel; }
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) this.setLayout(new BorderLayout(0, 5)); setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 5)); JLabel jtitle = new JLabel(title); HorizontalPanel buttons = new HorizontalPanel(); buttons.add(jtitle); buttons.add(browse); buttons.add(delete); buttons.add(clear); add(buttons,BorderLayout.NORTH); this.initializeTableModel(); files = new JTable(tableModel); JMeterUtils.applyHiDPI(files); files.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); files.revalidate(); JScrollPane scrollpane = new JScrollPane(files); scrollpane.setPreferredSize(new Dimension(100,80)); add(scrollpane,BorderLayout.CENTER); browse.setActionCommand(ACTION_BROWSE); // $NON-NLS-1$ browse.addActionListener(this); clear.addActionListener(this); delete.addActionListener(this); }
private JPanel createContentTypePanel() { contentTypeInclude = new JTextField(35); contentTypeInclude.addKeyListener(this); contentTypeInclude.setName(ENABLE_RESTART); JLabel labelInclude = new JLabel(JMeterUtils.getResString("proxy_content_type_include")); // $NON-NLS-1$ labelInclude.setLabelFor(contentTypeInclude); // Default value contentTypeInclude.setText(JMeterUtils.getProperty("proxy.content_type_include")); // $NON-NLS-1$ contentTypeExclude = new JTextField(35); contentTypeExclude.addKeyListener(this); contentTypeExclude.setName(ENABLE_RESTART); JLabel labelExclude = new JLabel(JMeterUtils.getResString("proxy_content_type_exclude")); // $NON-NLS-1$ labelExclude.setLabelFor(contentTypeExclude); // Default value contentTypeExclude.setText(JMeterUtils.getProperty("proxy.content_type_exclude")); // $NON-NLS-1$ HorizontalPanel panel = new HorizontalPanel(); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("proxy_content_type_filter"))); // $NON-NLS-1$ panel.add(labelInclude); panel.add(contentTypeInclude); panel.add(labelExclude); panel.add(contentTypeExclude); return panel; }
private JPanel createGroupingPanel() { DefaultComboBoxModel<String> m = new DefaultComboBoxModel<>(); // Note: position of these elements in the menu *must* match the // corresponding ProxyControl.GROUPING_* values. m.addElement(JMeterUtils.getResString("grouping_no_groups")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_add_separators")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_in_controllers")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_store_first_only")); // $NON-NLS-1$ m.addElement(JMeterUtils.getResString("grouping_in_transaction_controllers")); // $NON-NLS-1$ groupingMode = new JComboBox<>(m); groupingMode.setPreferredSize(new Dimension(150, 20)); groupingMode.setSelectedIndex(0); groupingMode.addItemListener(this); JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode")); // $NON-NLS-1$ label2.setLabelFor(groupingMode); HorizontalPanel panel = new HorizontalPanel(); panel.add(label2); panel.add(groupingMode); return panel; }
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout(0, 10)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); JPanel mainPanel = new JPanel(new BorderLayout()); // USER_INPUT HorizontalPanel md5HexPanel = new HorizontalPanel(); md5HexPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("md5hex_assertion_md5hex_test"))); // $NON-NLS-1$ md5HexPanel.add(new JLabel(JMeterUtils.getResString("md5hex_assertion_label"))); //$NON-NLS-1$ md5HexInput = new JTextField(25); md5HexPanel.add(md5HexInput); mainPanel.add(md5HexPanel, BorderLayout.NORTH); add(mainPanel, BorderLayout.CENTER); }
private JPanel createTestPlanContentPanel() { httpHeaders = new JCheckBox(JMeterUtils.getResString("proxy_headers")); // $NON-NLS-1$ httpHeaders.setSelected(true); // maintain original default httpHeaders.addActionListener(this); httpHeaders.setActionCommand(ENABLE_RESTART); addAssertions = new JCheckBox(JMeterUtils.getResString("proxy_assertions")); // $NON-NLS-1$ addAssertions.setSelected(false); addAssertions.addActionListener(this); addAssertions.setActionCommand(ENABLE_RESTART); regexMatch = new JCheckBox(JMeterUtils.getResString("proxy_regex")); // $NON-NLS-1$ regexMatch.setSelected(false); regexMatch.addActionListener(this); regexMatch.setActionCommand(ENABLE_RESTART); VerticalPanel mainPanel = new VerticalPanel(); mainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("proxy_test_plan_content"))); // $NON-NLS-1$ HorizontalPanel nodeCreationPanel = new HorizontalPanel(); nodeCreationPanel.add(createGroupingPanel()); nodeCreationPanel.add(httpHeaders); nodeCreationPanel.add(addAssertions); nodeCreationPanel.add(regexMatch); HorizontalPanel targetPanel = new HorizontalPanel(); targetPanel.add(createTargetPanel()); mainPanel.add(targetPanel); mainPanel.add(nodeCreationPanel); return mainPanel; }
/** * Inits the GUI. */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout(0, 10)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); JPanel mainPanel = new JPanel(new BorderLayout()); // USER_INPUT VerticalPanel assertionPanel = new VerticalPanel(); assertionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "XML Schema")); // doctype HorizontalPanel xmlSchemaPanel = new HorizontalPanel(); xmlSchemaPanel.add(new JLabel(JMeterUtils.getResString("xmlschema_assertion_label"))); //$NON-NLS-1$ xmlSchema = new JTextField(26); xmlSchemaPanel.add(xmlSchema); assertionPanel.add(xmlSchemaPanel); mainPanel.add(assertionPanel, BorderLayout.NORTH); add(mainPanel, BorderLayout.CENTER); } }
private JPanel createTargetPanel() { targetNodesModel = new DefaultComboBoxModel<>(); targetNodes = new JComboBox<>(targetNodesModel); targetNodes.setPrototypeDisplayValue(""); // $NON-NLS-1$ // Bug 56303 fixed the width of combo list JPopupMenu popup = (JPopupMenu) targetNodes.getUI().getAccessibleChild(targetNodes, 0); // get popup element JScrollPane scrollPane = findScrollPane(popup); if(scrollPane != null) { scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL)); // add scroll pane if label element is too long scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); } targetNodes.setActionCommand(CHANGE_TARGET); // Action listener will be added later JLabel label = new JLabel(JMeterUtils.getResString("proxy_target")); // $NON-NLS-1$ label.setLabelFor(targetNodes); HorizontalPanel panel = new HorizontalPanel(); panel.add(label); panel.add(targetNodes); return panel; }
numMessagesPanel.add(new JLabel(numMessagesLabel)); ButtonGroup nmbg = new ButtonGroup(); allMessagesButton = new JRadioButton(allMessagesLabel); someMessagesField = new JTextField(5); allMessagesButton.setSelected(true); numMessagesPanel.add(allMessagesButton); numMessagesPanel.add(someMessagesButton); numMessagesPanel.add(someMessagesField);
VerticalPanel resourceConfigPanel = new VerticalPanel(); HorizontalPanel oAuthPanel = new HorizontalPanel(); oAuthPanel.add(consumerKey); oAuthPanel.add(consumerSecret); HorizontalPanel panel1 = new HorizontalPanel(); panel1.add(httpMethods); panel1.add(useKeepAlive); panel1.add(automaticRedirect); HorizontalPanel panel2 = new HorizontalPanel(); panel2.add(hostBaseUrl); panel2.add(port); HorizontalPanel panel3 = new HorizontalPanel(); panel3.add(resource); resourceConfigPanel.add(panel1); resourceConfigPanel.add(oAuthPanel);
docTypePanel.add(new JLabel("Doctype:")); docTypePanel.add(docTypeBox); assertionPanel.add(docTypePanel); thresholdPanel.add(new JLabel("Error threshold:")); errorThresholdField = new JTextField("0", 5); // $NON-NLS-1$ errorThresholdField.setName(ERROR_THRESHOLD_FIELD); errorThresholdField.addKeyListener(this); thresholdPanel.add(errorThresholdField); thresholdPanel.add(new JLabel("Warning threshold:")); warningThresholdField = new JTextField("0", 5); // $NON-NLS-1$ warningThresholdField.setName(WARNING_THRESHOLD_FIELD); warningThresholdField.addKeyListener(this); thresholdPanel.add(warningThresholdField); assertionPanel.add(thresholdPanel);
VerticalPanel resourceConfigPanel = new VerticalPanel(); HorizontalPanel oAuthPanel = new HorizontalPanel(); oAuthPanel.add(consumerKey); oAuthPanel.add(consumerSecret); HorizontalPanel panel1 = new HorizontalPanel(); panel1.add(httpMethods); panel1.add(useKeepAlive); panel1.add(automaticRedirect); HorizontalPanel panel2 = new HorizontalPanel(); panel2.add(hostBaseUrl); panel2.add(port); HorizontalPanel panel3 = new HorizontalPanel(); panel3.add(resource); resourceConfigPanel.add(panel1); resourceConfigPanel.add(oAuthPanel);
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout(0, 5)); serverPanel = new ServerPanel(); if (displayName) { setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); } VerticalPanel mainPanel = new VerticalPanel(); classname = new JLabeledTextField(JMeterUtils.getResString("tcp_classname")); // $NON-NLS-1$ mainPanel.add(classname); mainPanel.add(serverPanel); HorizontalPanel optionsPanel = new HorizontalPanel(); optionsPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder())); optionsPanel.add(createClosePortPanel()); optionsPanel.add(createCloseConnectionPanel()); optionsPanel.add(createNoDelayPanel()); optionsPanel.add(createSoLingerOption()); optionsPanel.add(createEolBytePanel()); mainPanel.add(optionsPanel); mainPanel.add(createRequestPanel()); add(mainPanel, BorderLayout.CENTER); } }