@Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() > 0) { ActionRouter.getInstance().doActionNow( new ActionEvent(e.getSource(), e.getID(), ActionNames.LINK_RELEASE_NOTES)); } } });
/** * Handles click on warnIndicator */ @Override public void actionPerformed(ActionEvent event) { if (event.getSource() == warnIndicator) { ActionRouter.getInstance().doActionNow( new ActionEvent(event.getSource(), event.getID(), ActionNames.LOGGER_PANEL_ENABLE_DISABLE)); } }
@Override public void actionPerformed(ActionEvent e) { String[] source = new String[] { Help.HELP_FUNCTIONS, functionList.getText() }; ActionRouter.getInstance().doActionNow( new ActionEvent(source, e.getID(), ActionNames.HELP)); } }
@Override public void doAction(ActionEvent ev) { try { String className = ev.getActionCommand().substring(ActionNames.LAF_PREFIX.length()).replace('/', '.'); UIManager.setLookAndFeel(className); JMeterUtils.refreshUI(); PREFS.put(USER_PREFS_KEY, className); int chosenOption = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils .getResString("laf_quit_after_change"), // $NON-NLS-1$ JMeterUtils.getResString("exit"), // $NON-NLS-1$ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (chosenOption == JOptionPane.YES_OPTION) { ActionRouter.getInstance().doActionNow(new ActionEvent(ev.getSource(), ev.getID(), ActionNames.EXIT)); } } catch (UnsupportedLookAndFeelException | InstantiationException | ClassNotFoundException | IllegalAccessException e) { JMeterUtils.reportErrorToUser("Look and Feel unavailable:" + e.toString()); } }
/** * Description of the Method * * @param e * Description of Parameter */ @Override public void doActionAfterCheck(ActionEvent e) { ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY)); GuiPackage guiPackage = GuiPackage.getInstance(); if (guiPackage.isDirty()) { int chosenOption = JOptionPane.showConfirmDialog(guiPackage.getMainFrame(), JMeterUtils .getResString("cancel_exit_to_save"), // $NON-NLS-1$ JMeterUtils.getResString("save?"), // $NON-NLS-1$ JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (chosenOption == JOptionPane.NO_OPTION) { System.exit(0); } else if (chosenOption == JOptionPane.YES_OPTION) { ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE)); if (!guiPackage.isDirty()) { System.exit(0); } } } else { System.exit(0); } } }
/** * Check if we should save before run * * @param e * the event that led to the call of this method */ protected void popupShouldSave(ActionEvent e) { log.debug("popupShouldSave"); if (GuiPackage.getInstance().getTestPlanFile() == null) { if (JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("should_save"), //$NON-NLS-1$ JMeterUtils.getResString("warning"), //$NON-NLS-1$ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE)); } } else if (GuiPackage.getInstance().shouldSaveBeforeRun()) { ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE)); } }
ActionRouter.getInstance().doActionNow( new ActionEvent(e.getSource(), e.getID(), ActionNames.LINK_FUNC_REF)); String[] source = new String[]{ActionNames.LINK_COMP_REF, GuiPackage.getInstance().getTreeListener().getCurrentNode().getDocAnchor()}; ActionRouter.getInstance().doActionNow( new ActionEvent(source, e.getID(), ActionNames.LINK_COMP_REF));
ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY)); GuiPackage guiPackage = GuiPackage.getInstance(); if (guiPackage.isDirty()) { JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE)) == JOptionPane.YES_OPTION) { ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE)); ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.STOP_THREAD)); closeProject(e); return true;
ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SEARCH_RESET)); Searcher searcher = createSearcher(wordToSearch); String regex = isRegexpCB.isSelected() ? wordToSearch : Pattern.quote(wordToSearch);
try { GuiPackage guiPackage = GuiPackage.getInstance(); ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY)); if (guiPackage.isDirty()) { int chosenOption = restartApplication(null); } else if (chosenOption == JOptionPane.YES_OPTION) { ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE)); if (!guiPackage.isDirty()) { restartApplication(null);
ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SEARCH_RESET));
ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.CHECK_DIRTY)); GuiPackage guiPackage = GuiPackage.getInstance(); if (guiPackage.isDirty()) { JOptionPane.QUESTION_MESSAGE); if(response == JOptionPane.YES_OPTION) { ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.SAVE)); ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.STOP_THREAD)); final File parent = template.getParent(); final File fileToCopy = parent != null
@Override public void doActionAfterCheck(ActionEvent e) { // Get the file name of the current project String projectFile = GuiPackage.getInstance().getTestPlanFile(); // Check if the user has loaded any file if (projectFile == null) { return; } // Check if the user wants to drop any changes ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY)); GuiPackage guiPackage = GuiPackage.getInstance(); if (guiPackage.isDirty()) { // Check if the user wants to revert int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("cancel_revert_project"), // $NON-NLS-1$ JMeterUtils.getResString("revert_project?"), // $NON-NLS-1$ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (response == JOptionPane.YES_OPTION) { // Close the current project Close.closeProject(e); // Reload the project Load.loadProjectFile(e, new File(projectFile), false); } } } }
ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.STOP_THREAD));
ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY)); FileServer.getFileServer().setScriptName(new File(updateFile).getName()); ActionRouter.getInstance().doActionNow(new ActionEvent(subTree, e.getID(), ActionNames.SUB_TREE_SAVED));
actionRouter.doActionNow(new ActionEvent(e.getSource(), e.getID(), actionName)); e.consume();