/** * This method performs the actual command processing. * * @param e * the generic UI action event */ @Override public void doActionAfterCheck(ActionEvent e) { performAction(e); }
closeProject(e); return true;
@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); } } } }
/** * Loads dragged file asking before for save if current open file is dirty. * @param e {@link ActionEvent} * @param file File to Load */ public static void loadProject(ActionEvent e, File file) { if(!Close.performAction(e)) { return; } Load.loadProjectFile(e, file, false); } }
@Override public void doActionAfterCheck(final ActionEvent e) { final JFileChooser chooser = FileDialoger.promptToOpenFile(new String[] { ".jmx" }); //$NON-NLS-1$ if (chooser == null) { return; } final File selectedFile = chooser.getSelectedFile(); if (selectedFile != null) { final boolean merging = e.getActionCommand().equals(ActionNames.MERGE); // We must ask the user if it is ok to close current project if (!merging) { // i.e. it is OPEN if (!Close.performAction(e)) { return; } } loadProjectFile(e, selectedFile, merging); } }
@Override public void doActionAfterCheck(ActionEvent e) { // We must ask the user if it is ok to close current project if (!Close.performAction(e)) { return; } // Load the file for this recent file command loadProjectFile(e, getRecentFile(e), false); }