}
StopRunningProfilesAction stopRunningAction = new StopRunningProfilesAction(profileManager, droidContext, this);
if (stopRunningAction.execute()) {
ProfileSelectionDialog dialog = new SaveAllProfilesDialog(this, droidContext.allDirtyProfiles());
final ExitAction action = new ExitAction(droidContext, dialog, profileManager);
action.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (STATE.equals(evt.getPropertyName()) && evt.getNewValue().equals(SwingWorker.StateValue.DONE)
&& !action.isCancelled()) {
setVisible(false);
log.info("Closing DROID.");
File tempDir = globalContext.getGlobalConfig().getTempDir();
ResourceUtils.attemptToDeleteTempFiles(tempDir);
// CHECKSTYLE:OFF
System.exit(0);
// CHECKSTYLE:ON
}
}
});
action.start();
}
}