Skip to content
Snippets Groups Projects
Commit b132a356 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Moved the logic of the force-save into the normal save.

parent a57ac5fb
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,7 @@ import kieker.webgui.common.PluginFinder; ...@@ -70,6 +70,7 @@ import kieker.webgui.common.PluginFinder;
import kieker.webgui.common.exception.LibraryAlreadyExistingException; import kieker.webgui.common.exception.LibraryAlreadyExistingException;
import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.NewerProjectException;
import org.primefaces.context.RequestContext;
import org.primefaces.event.FileUploadEvent; import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.DefaultTreeNode; import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.TreeNode; import org.primefaces.model.TreeNode;
...@@ -553,6 +554,8 @@ public final class CurrentAnalysisEditorBean { ...@@ -553,6 +554,8 @@ public final class CurrentAnalysisEditorBean {
} catch (final NewerProjectException ex) { } catch (final NewerProjectException ex) {
CurrentAnalysisEditorBean.LOG.info("The project has been modified externally in the meanwhile.", ex); CurrentAnalysisEditorBean.LOG.info("The project has been modified externally in the meanwhile.", ex);
CurrentAnalysisEditorBean.showMessage(FacesMessage.SEVERITY_WARN, "The project has been modified externally in the meanwhile."); CurrentAnalysisEditorBean.showMessage(FacesMessage.SEVERITY_WARN, "The project has been modified externally in the meanwhile.");
// Give the user the possibility to force-save the project
RequestContext.getCurrentInstance().execute("forceSaveDlg.show()");
} }
} }
} }
......
...@@ -46,8 +46,7 @@ ...@@ -46,8 +46,7 @@
<p:menubar> <p:menubar>
<p:submenu label="File"> <p:submenu label="File">
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project" update=":messages" ajax="true" action="#{currentAnalysisEditorBean.saveProject(false)}" disabled="#{empty currentAnalysisEditorBean.project}"/> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project" update=":messages" ajax="true" action="#{currentAnalysisEditorBean.saveProject(false)}" disabled="#{empty currentAnalysisEditorBean.project}"/>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project As" update=":messages" ajax="true" disabled="#{empty currentAnalysisEditorBean.project}"/> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project As" update=":messages" ajax="true" disabled="#{true or empty currentAnalysisEditorBean.project}"/>
<p:menuitem styleClass="element-with-whitespace Force-Save-Project-Button" icon="ui-icon-alert" value=" Force Save Project" update=":messages" ajax="true" action="#{currentAnalysisEditorBean.saveProject(true)}" disabled="#{empty currentAnalysisEditorBean.project}"/>
<p:separator /> <p:separator />
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-refresh" value=" Reload Project" ajax="true" disabled="#{empty currentAnalysisEditorBean.project or true}" /> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-refresh" value=" Reload Project" ajax="true" disabled="#{empty currentAnalysisEditorBean.project or true}" />
<p:separator/> <p:separator/>
...@@ -210,5 +209,7 @@ ...@@ -210,5 +209,7 @@
<ui:include src="dialogs/connectionDialog.xhtml" /> <ui:include src="dialogs/connectionDialog.xhtml" />
<ui:include src="dialogs/manageLibrariesDialog.xhtml" /> <ui:include src="dialogs/manageLibrariesDialog.xhtml" />
<ui:include src="dialogs/forceSaveDialog.xhtml" />
</h:body> </h:body>
</html> </html>
\ No newline at end of file
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<p:dialog header="Save Project" resizable="false" modal="true"
widgetVar="forceSaveDlg" id="forceSaveDialog">
<h:form>
<div style="text-align: center">
<h:outputText value="The project has been modified externally in the meanwhile. Do you want to overwrite the changes?" />
</div>
<hr/>
<div style="text-align: right">
<p:commandButton value="Yes" action="#{currentAnalysisEditorBean.saveProject(true)}" oncomplete="forceSaveDlg.hide()" update=":messages" />
<p:spacer width="10px" height="10" />
<p:commandButton value="Cancel" onclick="forceSaveDlg.hide()" />
</div>
</h:form>
</p:dialog>
</ui:composition>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment