return "icon-save.gif";
}
@Override
protected boolean saveAll() throws Exception {
Project p = getCurrentProject();
if (p == null || p.getConfigurationResource() == null) {
return super.saveAll();
}
else {
String oldPath = p.getConfigurationResource().getURL().getPath();
getProjectController().getProjectWatcher().pauseWatching();
ProjectSaver saver = getApplication().getInjector().getInstance(
ProjectSaver.class);
saver.save(p);
RenamedPreferences.removeOldPreferences();
// if change DataChanelDescriptor name - as result change name of xml file
// we will need change preferences path
String[] path = oldPath.split("/");
String[] newPath = p.getConfigurationResource().getURL().getPath().split("/");
if (!path[path.length - 1].equals(newPath[newPath.length - 1])) {
String newName = newPath[newPath.length - 1].replace(".xml", "");
RenamedPreferences.copyPreferences(
newName,
getProjectController().getPreferenceForProject());
RenamedPreferences.removeOldPreferences();
}
getApplication().getFrameController().changePathInLastProjListAction(
oldPath,
p.getConfigurationResource().getURL().getPath());
Application.getFrame().fireRecentFileListChanged();
/**
* Reset the watcher now
*/