/** * 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); } } }
GuiPackage guiPackage = GuiPackage.getInstance(); ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY)); if (guiPackage.isDirty()) { int chosenOption = JOptionPane.showConfirmDialog(guiPackage.getMainFrame(), JMeterUtils } 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.CHECK_DIRTY)); GuiPackage guiPackage = GuiPackage.getInstance(); if (guiPackage.isDirty()) { int response; if ((response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), if (guiPackage.isDirty()) { return false;
dirty = true; } else if (action.equals(ActionNames.UNDO) || action.equals(ActionNames.REDO)) { dirty = GuiPackage.getInstance().isDirty(); log.debug("Restoring dirty after undo/redo");
@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); } } } }
boolean dirty = guiPackage != null ? guiPackage.isDirty() : false; addEdit(new UndoHistoryItem(copy, comment, TreeState.from(guiPackage), dirty));
ActionRouter.getInstance().doActionNow(new ActionEvent(actionEvent.getSource(), actionEvent.getID(), ActionNames.CHECK_DIRTY)); GuiPackage guiPackage = GuiPackage.getInstance(); if (guiPackage.isDirty()) {
if (GuiPackage.getInstance().isDirty()) { File fileToBackup = new File(updateFile); log.debug("Test plan has changed, make backup of {}", fileToBackup);