@Override public void actionPerformed(ActionEvent e) { setVisible(false); } };
/** * @param owner The {@link Frame} from which the dialog is displayed * @param title The string to be used as a title of this dialog * @param modal specifies whether the dialog should be modal * @param s The details, which sample attributes are to be saved * @throws java.awt.HeadlessException - when run headless */ public SavePropertyDialog(Frame owner, String title, boolean modal, SampleSaveConfiguration s) { super(owner, title, modal); saveConfig = s; log.debug("SampleSaveConfiguration = {}", saveConfig);// $NON-NLS-1$ initDialog(); }
@Override public void actionPerformed(ActionEvent e) { SavePropertyDialog d = new SavePropertyDialog( GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("sample_result_save_configuration"), // $NON-NLS-1$ true, collector.getSaveConfig()); d.pack(); ComponentUtil.centerComponentInComponent(GuiPackage.getInstance().getMainFrame(), d); d.setVisible(true); } });
private void initDialog() { this.getContentPane().setLayout(new BorderLayout()); final int configCount = (SampleSaveConfiguration.SAVE_CONFIG_NAMES.size() / 3) + 1; log.debug("grid panel is {} by {}", 3, configCount); JPanel checkPanel = new JPanel(new GridLayout(configCount, 3)); for (final String name : SampleSaveConfiguration.SAVE_CONFIG_NAMES) { try { JCheckBox check = new JCheckBox( JMeterUtils.getResString(RESOURCE_PREFIX + name), getSaveState(SampleSaveConfiguration.getterName(name))); check.addActionListener(this); final String actionCommand = SampleSaveConfiguration.setterName(name); // $NON-NLS-1$ check.setActionCommand(actionCommand); if (!functors.containsKey(actionCommand)) { functors.put(actionCommand, new Functor(actionCommand)); } checkPanel.add(check, BorderLayout.NORTH); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { log.warn("Problem creating save config dialog", e); } } getContentPane().add(checkPanel, BorderLayout.NORTH); JButton exit = new JButton(JMeterUtils.getResString("done")); // $NON-NLS-1$ this.getContentPane().add(exit, BorderLayout.SOUTH); exit.addActionListener(e -> dispose()); }
SavePropertyDialog d = new SavePropertyDialog(GuiPackage .getInstance().getMainFrame(), JMeterUtils .getResString("sample_result_save_configuration"), true, collector.getSaveConfig()); d.pack(); ComponentUtil.centerComponentInComponent(GuiPackage.getInstance() .getMainFrame(), d); d.setVisible(true);
SavePropertyDialog d = new SavePropertyDialog(GuiPackage .getInstance().getMainFrame(), JMeterUtils .getResString("sample_result_save_configuration"), true, collector.getSaveConfig()); d.pack(); ComponentUtil.centerComponentInComponent(GuiPackage.getInstance() .getMainFrame(), d); d.setVisible(true); break;