@Override public void actionPerformed(ActionEvent e) { GuiUtils.cancelEditing(table); int[] rowsSelected = table.getSelectedRows(); if (rowsSelected.length > 0 && rowsSelected[rowsSelected.length - 1] < table.getRowCount() - 1) { table.clearSelection(); for (int i = rowsSelected.length - 1; i >= 0; i--) { int rowSelected = rowsSelected[i]; model.moveRow(rowSelected, rowSelected + 1, rowSelected + 1); } for (int rowSelected : rowsSelected) { table.addRowSelectionInterval(rowSelected + 1, rowSelected + 1); } } } }
/** * Stop any editing that is currently being done on the table. This will * save any changes that have already been made. * Needed for subclasses */ protected void stopTableEditing() { GuiUtils.stopTableEditing(table); }
@Override public void actionPerformed(ActionEvent e) { try { String clipboardContent = GuiUtils.getPastedText(); if(clipboardContent == null) { return; } String[] clipboardLines = clipboardContent.split("\n"); // $NON-NLS-1$ for (String clipboardLine : clipboardLines) { String[] columns = clipboardLine.split("\t"); // $NON-NLS-1$ model.addRow(clazz.newInstance()); for (int i=0; i < columns.length; i++) { model.setValueAt(columns[i], model.getRowCount() - 1, i); } } if(model.getRowCount()>1) { upButton.setEnabled(true); downButton.setEnabled(true); } else { upButton.setEnabled(false); downButton.setEnabled(false); } } catch (Exception err) { log.error("The class type given to TableEditor was not instantiable.", err); } } }
GuiUtils.stopTableEditing(this.headerTable); int rowCount = headerTable.getRowCount(); try { String clipboardContent = GuiUtils.getPastedText(); if(clipboardContent == null) { return;
GuiUtils.cancelEditing(jmsPropertiesTable); GuiUtils.stopTableEditing(jmsPropertiesTable);
/** * @return RegExp Tester panel */ private JPanel createRegexpPanel() { regexpDataField = new JTextArea(); regexpDataField.setEditable(false); regexpDataField.setLineWrap(true); regexpDataField.setWrapStyleWord(true); JScrollPane regexpDataPane = GuiUtils.makeScrollPane(regexpDataField); regexpDataPane.setPreferredSize(new Dimension(0, 200)); JPanel pane = new JPanel(new BorderLayout(0, 5)); JSplitPane mainSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, regexpDataPane, createRegexpTasksPanel()); mainSplit.setDividerLocation(0.6d); mainSplit.setOneTouchExpandable(true); pane.add(mainSplit, BorderLayout.CENTER); return pane; }
private JPanel createGraphFontValuePane() { JPanel fontValueStylePane = new JPanel(); fontValueStylePane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); fontValueStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_value_font"), //$NON-NLS-1$ valueFontNameList)); valueFontNameList.setSelectedIndex(0); // default: sans serif fontValueStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), //$NON-NLS-1$ valueFontSizeList)); valueFontSizeList.setSelectedItem(StatGraphProperties.getFontSize()[2]); // default: 10 fontValueStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), //$NON-NLS-1$ valueFontStyleList)); valueFontStyleList.setSelectedItem(JMeterUtils.getResString("fontstyle.normal")); // default: normal //$NON-NLS-1$ return fontValueStylePane; }
String functionCall = buildFunctionCallString(functionName, args); cutPasteFunction.setText(functionCall); GuiUtils.copyTextToClipboard(cutPasteFunction.getText()); CompoundVariable function = new CompoundVariable(functionCall); JMeterContext threadContext = JMeterContextService.getContext();
GuiUtils.stopTableEditing(table); int rowCount = table.getRowCount(); try { String clipboardContent = GuiUtils.getPastedText(); if (clipboardContent != null) { PowerTableModel model = null;
GuiUtils.cancelEditing(cookieTable); GuiUtils.stopTableEditing(cookieTable);
/** * @return boundaryExtractor Tester panel */ private JPanel createBoundaryExtractorPanel() { boundaryExtractorDataField = new JTextArea(); boundaryExtractorDataField.setEditable(false); boundaryExtractorDataField.setLineWrap(true); boundaryExtractorDataField.setWrapStyleWord(true); JScrollPane boundaryExtractorDataPane = GuiUtils.makeScrollPane(boundaryExtractorDataField); boundaryExtractorDataPane.setPreferredSize(new Dimension(0, 200)); JPanel pane = new JPanel(new BorderLayout(0, 5)); JSplitPane mainSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, boundaryExtractorDataPane, createBoundaryExtractorTasksPanel()); mainSplit.setDividerLocation(0.6d); mainSplit.setOneTouchExpandable(true); pane.add(mainSplit, BorderLayout.CENTER); return pane; }
private JPanel createLinePane() { JPanel lineStylePane = new JPanel(); lineStylePane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); lineStylePane.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), JMeterUtils.getResString("graph_resp_time_settings_line"))); // $NON-NLS-1$ lineStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("graph_resp_time_stroke_width"), //$NON-NLS-1$ strokeWidthList)); strokeWidthList.setSelectedItem(StatGraphProperties.getStrokeWidth()[DEFAULT_STROKE_WIDTH_LIST]); lineStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("graph_resp_time_shape_label"), //$NON-NLS-1$ pointShapeLine)); pointShapeLine.setSelectedIndex(DEFAULT_LINE_SHAPE_POINT); return lineStylePane; }
/** * Stop any editing that is currently being done on the table. This will * save any changes that have already been made. */ protected void stopTableEditing() { GuiUtils.stopTableEditing(table); }
@Override public void actionPerformed(ActionEvent e) { GuiUtils.cancelEditing(table); int[] rowsSelected = table.getSelectedRows(); if (rowsSelected.length > 0 && rowsSelected[0] > 0) { table.clearSelection(); for (int rowSelected : rowsSelected) { model.moveRow(rowSelected, rowSelected + 1, rowSelected - 1); } for (int rowSelected : rowsSelected) { table.addRowSelectionInterval(rowSelected - 1, rowSelected - 1); } } } }
GuiUtils.stopTableEditing(table); int rowCount = table.getRowCount(); try { String clipboardContent = GuiUtils.getPastedText(); if(clipboardContent == null) { return;
/** * Create the Regexp task pane * * @return Regexp task pane */ private JPanel createRegexpTasksPanel() { JPanel regexpActionPanel = new JPanel(); regexpActionPanel.setLayout(new BoxLayout(regexpActionPanel, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(5, 5, 0, 5); regexpActionPanel.setBorder(margin); regexpField = new JLabeledTextField(JMeterUtils.getResString("regexp_tester_field")); // $NON-NLS-1$ regexpActionPanel.add(regexpField, BorderLayout.WEST); JButton regexpTester = new JButton(JMeterUtils.getResString("regexp_tester_button_test")); // $NON-NLS-1$ regexpTester.setActionCommand(REGEXP_TESTER_COMMAND); regexpTester.addActionListener(this); regexpActionPanel.add(regexpTester, BorderLayout.EAST); regexpResultField = new JTextArea(); regexpResultField.setEditable(false); regexpResultField.setLineWrap(true); regexpResultField.setWrapStyleWord(true); JPanel regexpTasksPanel = new JPanel(new BorderLayout(0, 5)); regexpTasksPanel.add(regexpActionPanel, BorderLayout.NORTH); regexpTasksPanel.add(GuiUtils.makeScrollPane(regexpResultField), BorderLayout.CENTER); return regexpTasksPanel; }
/** * Create pane for legend settings * @return Legend pane */ private JPanel createLegendPane() { JPanel legendPanel = new JPanel(); legendPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); legendPanel.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), JMeterUtils.getResString("aggregate_graph_legend"))); // $NON-NLS-1$ legendPanel.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_legend_placement"), //$NON-NLS-1$ legendPlacementList)); legendPlacementList.setSelectedIndex(DEFAULT_LEGEND_PLACEMENT); legendPanel.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_font"), //$NON-NLS-1$ fontNameList)); fontNameList.setSelectedIndex(DEFAULT_LEGEND_FONT); legendPanel.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), //$NON-NLS-1$ fontSizeList)); fontSizeList.setSelectedItem(StatGraphProperties.getFontSize()[DEFAULT_LEGEND_SIZE]); legendPanel.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), //$NON-NLS-1$ fontStyleList)); fontStyleList.setSelectedIndex(DEFAULT_LEGEND_STYLE); return legendPanel; }
/** * Stop any editing that is currently being done on the table. This will * save any changes that have already been made. */ protected void stopTableEditing() { GuiUtils.stopTableEditing(table); }
@Override public void actionPerformed(ActionEvent e) { GuiUtils.cancelEditing(stringTable); int[] rowsSelected = stringTable.getSelectedRows(); stringTable.clearSelection(); if (rowsSelected.length > 0) { for (int i = rowsSelected.length - 1; i >= 0; i--) { tableModel.removeRow(rowsSelected[i]); } tableModel.fireTableDataChanged(); } else { if(tableModel.getRowCount()>0) { tableModel.removeRow(0); tableModel.fireTableDataChanged(); } } if (stringTable.getModel().getRowCount() == 0) { deletePattern.setEnabled(false); } } }
@Override public void actionPerformed(ActionEvent e) { deletePattern.setEnabled(true); GuiUtils.stopTableEditing(stringTable); int rowCount = stringTable.getRowCount(); try { String clipboardContent = GuiUtils.getPastedText(); if(clipboardContent == null) { return;