diff --git a/Kieker.WebGUI/lib/kieker-1.6-SNAPSHOT_emf.jar b/Kieker.WebGUI/lib/kieker-1.6-SNAPSHOT_emf.jar index a604ad9d242420b7e6b70965f194bc5df3f95201..bfe34cea23b73ff63b44168505e17fa9f7962db0 100644 Binary files a/Kieker.WebGUI/lib/kieker-1.6-SNAPSHOT_emf.jar and b/Kieker.WebGUI/lib/kieker-1.6-SNAPSHOT_emf.jar differ diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/IProjectBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/IProjectBean.java new file mode 100644 index 0000000000000000000000000000000000000000..dfdcc0f13c9fedb3037500183b87d8a19e7db0e5 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/IProjectBean.java @@ -0,0 +1,11 @@ +package kieker.webgui.beans; + +public interface IProjectBean { + + public String clearProject(); + + public String getProjectName(); + + public String setProject(final String name); + +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ForwardBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ForwardBean.java new file mode 100644 index 0000000000000000000000000000000000000000..ae88e99be7263a1c5b97692306ddeb85c1c8f99a --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ForwardBean.java @@ -0,0 +1,43 @@ +package kieker.webgui.beans.application; + +import javax.faces.bean.ApplicationScoped; +import javax.faces.bean.ManagedBean; + +import kieker.webgui.beans.IProjectBean; + +/** + * This bean is a helper class to change for example from the analysis editor to the cockpit. It clears the source bean (by using the clear-method) and sets the + * project name of the new destination bean, returning its return value. + * + * @author Nils Christian Ehmke + * @version 1.0 + */ +@ManagedBean +@ApplicationScoped +public class ForwardBean { + + /** + * Default constructor. + */ + public ForwardBean() { + // No code necessary. + } + + /** + * Moves from one page to another. This method clears the source bean (by using the clear-method) and sets the + * project name of the new destination bean, returning its return value. + * + * @param sourceBean + * The source bean. + * @param destinationBean + * The destination bean. + * @return The return value of the destination bean. + */ + public String forward(final IProjectBean sourceBean, final IProjectBean destinationBean) { + final String projectName = sourceBean.getProjectName(); + + sourceBean.clearProject(); + + return destinationBean.setProject(projectName); + } +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentAnalysisEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentAnalysisEditorBean.java index 17e405a227bfa0f90df88b0ef6cc3f79e78aa42a..21ce6c73b6af2dc8be3cc3dd3f63d43849876eeb 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentAnalysisEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentAnalysisEditorBean.java @@ -60,6 +60,7 @@ import kieker.common.configuration.Configuration; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; import kieker.monitoring.core.registry.Registry; +import kieker.webgui.beans.IProjectBean; import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.ConnectionFilterToFilter; import kieker.webgui.common.ConnectionFilterToRepository; @@ -87,7 +88,7 @@ import org.eclipse.emf.ecore.EObject; */ @ManagedBean @SessionScoped -public final class CurrentAnalysisEditorBean { +public final class CurrentAnalysisEditorBean implements IProjectBean { /** * This is the log for errors, exceptions etc. */ @@ -181,6 +182,7 @@ public final class CurrentAnalysisEditorBean { * The name of the project. * @return The name of the page for the project work space, if the project has been accepted, '' if it is null. */ + @Override public String setProject(final String newName) { synchronized (this) { // Remember the given parameters @@ -395,6 +397,7 @@ public final class CurrentAnalysisEditorBean { * * @return The project name for this user. */ + @Override public String getProjectName() { synchronized (this) { return this.projectName; @@ -417,6 +420,7 @@ public final class CurrentAnalysisEditorBean { * * @return The name of the page of the project overview. */ + @Override public String clearProject() { synchronized (this) { this.project = null; // NOPMD @@ -548,7 +552,6 @@ public final class CurrentAnalysisEditorBean { // Update the time stamp! this.resetTimeStamp(); } catch (final IOException ex) { - ex.printStackTrace(); CurrentAnalysisEditorBean.LOG.error("An error occured while saving the project.", ex); CurrentAnalysisEditorBean.showMessage(FacesMessage.SEVERITY_ERROR, "An error occured while saving the project."); } catch (final NewerProjectException ex) { diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitBean.java index 56fb1156afc8b1b64c5060f50c6c1c76fa985e53..666d6de238159045784bf27fb3557e90ec4caf82 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitBean.java @@ -29,6 +29,7 @@ import kieker.analysis.display.Image; import kieker.analysis.display.PlainText; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIView; +import kieker.webgui.beans.IProjectBean; import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.ACManager; import kieker.webgui.common.Global; @@ -41,7 +42,7 @@ import kieker.webgui.common.Global; */ @ManagedBean @SessionScoped -public class CurrentCockpitBean { +public class CurrentCockpitBean implements IProjectBean { /** * This is the name of the stored project. It can be used as an identifier within the FS-Manager @@ -81,6 +82,7 @@ public class CurrentCockpitBean { * The name of the project. * @return The name of the page for the cockpit. */ + @Override public String setProject(final String newName) { synchronized (this) { // Remember the given parameters @@ -103,6 +105,7 @@ public class CurrentCockpitBean { * * @return The project name for this user. */ + @Override public String getProjectName() { synchronized (this) { return this.projectName; @@ -220,6 +223,7 @@ public class CurrentCockpitBean { * * @return The name of the page of the project overview. */ + @Override public String clearProject() { synchronized (this) { this.projectName = null; // NOPMD diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitEditorBean.java index 0ed7953d3538b4cd4fd176f8c11402c12d692d39..69252c5963f1646534c0f7c2b44788136d82402a 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitEditorBean.java @@ -24,27 +24,33 @@ import java.io.IOException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; +import java.util.UUID; import javax.faces.application.FacesMessage; import javax.faces.application.FacesMessage.Severity; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; +import javax.faces.component.UIComponent; +import javax.faces.component.UIInput; import javax.faces.context.FacesContext; import kieker.analysis.display.annotation.Display; import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDisplay; +import kieker.analysis.model.analysisMetaModel.MIDisplayConnector; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIView; import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; import kieker.analysis.plugin.AbstractPlugin; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; +import kieker.webgui.beans.IProjectBean; import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.FSManager; import kieker.webgui.common.Global; import kieker.webgui.common.exception.NewerProjectException; +import org.primefaces.context.RequestContext; import org.primefaces.event.TabChangeEvent; /** @@ -55,7 +61,7 @@ import org.primefaces.event.TabChangeEvent; */ @ManagedBean @SessionScoped -public class CurrentCockpitEditorBean { +public class CurrentCockpitEditorBean implements IProjectBean { /** * This is the log for errors, exceptions etc. */ @@ -106,6 +112,7 @@ public class CurrentCockpitEditorBean { * The name of the project. * @return The name of the page for the analysis view work space. */ + @Override public String setProject(final String newName) { synchronized (this) { // Remember the given parameters @@ -132,6 +139,7 @@ public class CurrentCockpitEditorBean { * * @return The project name for this user. */ + @Override public String getProjectName() { synchronized (this) { return this.projectName; @@ -143,6 +151,7 @@ public class CurrentCockpitEditorBean { * * @return The name of the page of the project overview. */ + @Override public String clearProject() { synchronized (this) { this.projectName = null; // NOPMD @@ -173,6 +182,8 @@ public class CurrentCockpitEditorBean { } catch (final NewerProjectException ex) { CurrentCockpitEditorBean.LOG.info("The project has been modified externally in the meanwhile.", ex); CurrentCockpitEditorBean.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()"); } } } @@ -275,7 +286,10 @@ public class CurrentCockpitEditorBean { public void addDisplayToView(final MIDisplay display) { synchronized (this) { if (this.activeView != null) { - this.activeView.getDisplays().add(display); + final MIDisplayConnector connector = this.factory.createDisplayConnector(); + connector.setDisplay(display); + connector.setName(UUID.randomUUID().toString()); + this.activeView.getDisplayConnectors().add(connector); } } } @@ -291,4 +305,48 @@ public class CurrentCockpitEditorBean { this.setActiveView((MIView) event.getData()); } } + + /** + * This method checks whether a display connector with the given name exists already. + * + * @param name + * The name to be checked. + * @return true iff the name exists already. + */ + private boolean existsDisplayConnectorName(final String name) { + synchronized (this) { + // Make sure a view is selected + if (this.activeView == null) { + return false; + } + + // Run through all display connectors and check the name against the given one + for (final MIDisplayConnector connector : this.activeView.getDisplayConnectors()) { + if (connector.getName().equals(name)) { + return true; + } + } + + // The name has not been found + return false; + } + } + + /** + * This method is used as a validator for new display connector names. + * + * @param context + * The context of the validation. + * @param toValidate + * The components which has be validated. + * @param value + * The new value. + */ + public void validateDisplayConnectorName(final FacesContext context, final UIComponent toValidate, final Object value) { + synchronized (this) { + final boolean nameExists = this.existsDisplayConnectorName((String) value); + ((UIInput) toValidate).setValid(!nameExists); + } + } + } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentControllerBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentControllerBean.java index 85735c7159fd792cfe762cddf4c0c536539e2fe2..8fa3f7f8cd0c4dbfbc9fb90cbf8661bf48a69b6a 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentControllerBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentControllerBean.java @@ -33,6 +33,7 @@ import kieker.analysis.exception.AnalysisConfigurationException; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; +import kieker.webgui.beans.IProjectBean; import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.ACManager; import kieker.webgui.common.Global; @@ -49,7 +50,7 @@ import kieker.webgui.common.exception.ProjectStillRunningException; */ @ManagedBean @SessionScoped -public class CurrentControllerBean { +public class CurrentControllerBean implements IProjectBean { /** * This is the log for errors, exceptions etc. */ @@ -77,6 +78,7 @@ public class CurrentControllerBean { * The name of the project. * @return The name of the page for the cockpit. */ + @Override public String setProject(final String newName) { synchronized (this) { // Remember the given parameters @@ -110,6 +112,7 @@ public class CurrentControllerBean { * * @return The project name for this user. */ + @Override public String getProjectName() { synchronized (this) { return this.projectName; @@ -121,6 +124,7 @@ public class CurrentControllerBean { * * @return The name of the page of the project overview. */ + @Override public String clearProject() { synchronized (this) { this.projectName = null; // NOPMD diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/ACManager.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/ACManager.java index 8b12737b558d3edf417485c3cbab4dde421790e1..fe136c583c7118316ae17d3e1384bce2523c5748 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/ACManager.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/ACManager.java @@ -38,7 +38,7 @@ import kieker.analysis.display.Image; import kieker.analysis.display.PlainText; import kieker.analysis.display.annotation.Display; import kieker.analysis.exception.AnalysisConfigurationException; -import kieker.analysis.model.analysisMetaModel.MIDisplay; +import kieker.analysis.model.analysisMetaModel.MIDisplayConnector; import kieker.analysis.model.analysisMetaModel.MIPlugin; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIView; @@ -381,8 +381,9 @@ public final class ACManager { // NOCS (Class Data Abstraction Coupling) for (final MIView view : this.myProject.getViews()) { final Map<String, AbstractDisplay> viewMap = new ConcurrentHashMap<String, AbstractDisplay>(); // NOPMD (Use of concurrent hash map) this.displayObjects.put(view.getName(), viewMap); - for (final MIDisplay display : view.getDisplays()) { - final Method displayMethod = UpdateDisplaysThread.getDisplayMethod(this.myPluginMap.get(display.getParent()).getClass(), display.getName()); + for (final MIDisplayConnector displayConnector : view.getDisplayConnectors()) { + final Method displayMethod = UpdateDisplaysThread.getDisplayMethod(this.myPluginMap.get(displayConnector.getDisplay().getParent()).getClass(), + displayConnector.getName()); // Make sure that the method really exists and that is has the correct parameters if ((displayMethod != null) && (displayMethod.getParameterTypes().length == 1)) { @@ -403,7 +404,7 @@ public final class ACManager { // NOCS (Class Data Abstraction Coupling) } } if (displayObject != null) { - viewMap.put(display.getName(), displayObject); + viewMap.put(displayConnector.getName(), displayObject); this.methodMap.put(displayObject, displayMethod); } } @@ -458,9 +459,9 @@ public final class ACManager { // NOCS (Class Data Abstraction Coupling) while (!this.terminated) { for (final MIView view : this.myProject.getViews()) { final Map<String, AbstractDisplay> viewMap = this.displayObjects.get(view.getName()); // NOPMD (Use of concurrent hash map) - for (final MIDisplay display : view.getDisplays()) { - final AbstractDisplay displayObject = viewMap.get(display.getName()); - final AbstractPlugin pluginObject = this.myPluginMap.get(display.getParent()); + for (final MIDisplayConnector displayConnector : view.getDisplayConnectors()) { + final AbstractDisplay displayObject = viewMap.get(displayConnector.getName()); + final AbstractPlugin pluginObject = this.myPluginMap.get(displayConnector.getDisplay().getParent()); // Update the display object try { this.methodMap.get(displayObject).invoke(pluginObject, displayObject); diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/FSManager.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/FSManager.java index 2ac8d3f115cb94adbe095613223eb6293eedfff7..692b5069cd17ad323eb48cb15b069a160f29d5d8 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/FSManager.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/FSManager.java @@ -188,6 +188,9 @@ public final class FSManager { // NOCS (Class Data Abstraction Coupling, Class F * If something went wrong during opening the file. */ public MIProject openProject(final String project) throws IOException { + if (project == null) { + throw new IOException("Project is null"); + } // Get the lock for the given project final Object lock = this.getLock(project); @@ -618,7 +621,7 @@ public final class FSManager { // NOCS (Class Data Abstraction Coupling, Class F /** * The list of libraries used to create the class loader. */ - final List<URL> libs; + private final List<URL> libs; /** * Creates a new instance of this class using the given parameters. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/Global.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/Global.java index 67d754b3239c9ac49810db9f4c175f49e136fe15..d221e174763e03daaf95b38f6a2e62aaf6d9b8da 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/Global.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/Global.java @@ -30,23 +30,23 @@ public final class Global { /** * This is the page used for the redirection to the controller page. */ - public static final String PAGE_ANALYSIS_CONTROLLER = "Controller.xhtml"; + public static final String PAGE_ANALYSIS_CONTROLLER = "Controller.xhtml?faces-redirect=true"; /** * This is the page used for the redirection to the overview. */ - public static final String PAGE_PROJECT_OVERVIEW = "ProjectOverview.xhtml"; + public static final String PAGE_PROJECT_OVERVIEW = "ProjectOverview.xhtml?faces-redirect=true"; /** * This is the page used for the redirection to the cockpit. */ - public static final String PAGE_ANALYSIS_COCKPIT = "Cockpit.xhtml"; + public static final String PAGE_ANALYSIS_COCKPIT = "Cockpit.xhtml?faces-redirect=true"; /** * This is the page used for the redirection to the cockpit editor. */ - public static final String PAGE_ANALYSIS_VIEW_WORK_SPACE = "CockpitEditor.xhtml"; + public static final String PAGE_ANALYSIS_VIEW_WORK_SPACE = "CockpitEditor.xhtml?faces-redirect=true"; /** * This is the page used for the redirection to the analysis editor. */ - public static final String PAGE_PROJECT_WORK_SPACE = "AnalysisEditor.xhtml"; + public static final String PAGE_PROJECT_WORK_SPACE = "AnalysisEditor.xhtml?faces-redirect=true"; /** * Default constructor. diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml index df9737f309d08b05a2e465c10cafbd4a9803736c..bf2d36a3b86ae555ee6bb2656c9dea9b141c2fdd 100644 --- a/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml +++ b/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml @@ -33,13 +33,13 @@ <h:outputText styleClass="kieker-title" value="Kieker » #{stringBean.shortenLongName(currentAnalysisEditorBean.projectName, 30)}"/> </p:toolbarGroup> <p:toolbarGroup align="right"> - <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="ProjectOverview.xhtml" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="#{currentAnalysisEditorBean.clearProject()}" /> <p:separator/> <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" disabled="true" ajax="false"/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-circle-triangle-e" value="Analysis" ajax="false" action="#{currentControllerBean.setProject(currentAnalysisEditorBean.projectName)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-circle-triangle-e" value="Analysis" ajax="false" action="#{forwardBean.forward(currentAnalysisEditorBean, currentControllerBean)}" /> <p:separator/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" action="#{currentCockpitEditorBean.setProject(currentAnalysisEditorBean.projectName)}" /> - <p:commandButton styleClass="perspective-button" icon="ui-icon-image" value="Cockpit" ajax="false" action="#{currentCockpitBean.setProject(currentAnalysisEditorBean.projectName)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" action="#{forwardBean.forward(currentAnalysisEditorBean, currentCockpitEditorBean)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-image" value="Cockpit" ajax="false" action="#{forwardBean.forward(currentAnalysisEditorBean, currentCockpitBean)}" /> </p:toolbarGroup> </p:toolbar> @@ -197,6 +197,20 @@ <!-- ******************************************************************************** --> </p:layout> + <p:dialog header="Save Project" resizable="false" modal="true" widgetVar="forceSaveDlg"> + <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> + <p:growl id="messages" life="1500" showDetail="true" autoUpdate="false" sticky="true"/> <!-- Include the dialog for the configuration. --> @@ -209,7 +223,6 @@ <ui:include src="dialogs/connectionDialog.xhtml" /> <ui:include src="dialogs/manageLibrariesDialog.xhtml" /> - - <ui:include src="dialogs/forceSaveDialog.xhtml" /> + </h:body> </html> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/Cockpit.xhtml b/Kieker.WebGUI/src/main/webapp/Cockpit.xhtml index 0dc646f979b66490a31b1d26a5e96e13432394d7..5c6e0cf46f243e16aaaf5d22e8a6406872856747 100644 --- a/Kieker.WebGUI/src/main/webapp/Cockpit.xhtml +++ b/Kieker.WebGUI/src/main/webapp/Cockpit.xhtml @@ -25,13 +25,13 @@ <h:outputText styleClass="kieker-title" value="Kieker » #{stringBean.shortenLongName(currentAnalysisEditorBean.projectName, 30)}"/> </p:toolbarGroup> <p:toolbarGroup align="right"> - <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="ProjectOverview.xhtml" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="#{currentCockpitBean.clearProject()}" /> <p:separator/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" ajax="false" action="#{currentAnalysisEditorBean.setProject(currentCockpitBean.projectName)}"/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-circle-triangle-e" value="Analysis" ajax="false" action="#{currentControllerBean.setProject(currentCockpitBean.projectName)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" ajax="false" action="#{forwardBean.forward(currentCockpitBean,currentAnalysisEditorBean)}"/> + <p:commandButton styleClass="perspective-button" icon="ui-icon-circle-triangle-e" value="Analysis" ajax="false" action="#{forwardBean.forward(currentCockpitBean,currentControllerBean)}" /> <p:separator/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" action="#{currentCockpitEditorBean.setProject(currentCockpitBean.projectName)}" /> - <p:commandButton styleClass="perspective-button" icon="ui-icon-image" value="Cockpit" ajax="false" disabled="true" action="#{currentCockpitBean.setProject(currentCockpitBean.projectName)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" action="#{forwardBean.forward(currentCockpitBean,currentCockpitEditorBean)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-image" value="Cockpit" ajax="false" disabled="true" /> </p:toolbarGroup> </p:toolbar> <p:menubar> @@ -56,9 +56,9 @@ <p:layoutUnit position="center" id="centerLayout"> <h:form id="centerForm"> - <ui:repeat value="#{currentCockpitBean.activeView.displays}" var="display"> - <p:panel header="#{display.name}"> - <h:outputText value="#{currentCockpitBean.updatePlainTextDisplay(display.name)}"/> + <ui:repeat value="#{currentCockpitBean.activeView.displayConnectors}" var="dispConnector"> + <p:panel header="#{dispConnector.name}"> + <h:outputText value="#{currentCockpitBean.updatePlainTextDisplay(dispConnector.name)}"/> </p:panel> </ui:repeat> </h:form> diff --git a/Kieker.WebGUI/src/main/webapp/CockpitEditor.xhtml b/Kieker.WebGUI/src/main/webapp/CockpitEditor.xhtml index 56b8679c120a9e3d020de0749c609f678d551cda..95bbb33183058511616da30044a2dfdaf96ecf2a 100644 --- a/Kieker.WebGUI/src/main/webapp/CockpitEditor.xhtml +++ b/Kieker.WebGUI/src/main/webapp/CockpitEditor.xhtml @@ -23,13 +23,13 @@ <h:outputText styleClass="kieker-title" value="Kieker » #{stringBean.shortenLongName(currentAnalysisEditorBean.projectName, 30)}"/> </p:toolbarGroup> <p:toolbarGroup align="right"> - <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="ProjectOverview.xhtml" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="#{currentCockpitEditorBean.clearProject()}" /> <p:separator/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" ajax="false" action="#{currentAnalysisEditorBean.setProject(currentCockpitEditorBean.projectName)}"/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-circle-triangle-e" value="Analysis" ajax="false" action="#{currentControllerBean.setProject(currentCockpitEditorBean.projectName)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" ajax="false" action="#{forwardBean.forward(currentCockpitEditorBean, currentAnalysisEditorBean)}"/> + <p:commandButton styleClass="perspective-button" icon="ui-icon-circle-triangle-e" value="Analysis" ajax="false" action="#{forwardBean.forward(currentCockpitEditorBean, currentControllerBean)}" /> <p:separator/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" disabled="true" action="#{currentCockpitEditorBean.setProject(currentCockpitEditorBean.projectName)}" /> - <p:commandButton styleClass="perspective-button" icon="ui-icon-image" value="Cockpit" ajax="false" action="#{currentCockpitBean.setProject(currentCockpitEditorBean.projectName)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" disabled="true" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-image" value="Cockpit" ajax="false" action="#{forwardBean.forward(currentCockpitEditorBean, currentCockpitBean)}" /> </p:toolbarGroup> </p:toolbar> <p:menubar> @@ -38,7 +38,6 @@ <p:separator/> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project" update=":messages" ajax="true" action="#{currentCockpitEditorBean.saveProject(false)}" disabled="#{empty currentCockpitEditorBean.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 Force-Save-Project-Button" icon="ui-icon-alert" value=" Force Save Project" update=":messages" ajax="true" action="#{currentCockpitEditorBean.saveProject(true)}" disabled="#{empty currentCockpitEditorBean.project}"/> <p:separator/> <p:menuitem styleClass="element-with-whitespace" icon="ui-icon-refresh" value=" Reload Project" ajax="true" disabled="#{empty currentCockpitEditorBean.project or true}"/> <p:separator/> @@ -80,18 +79,20 @@ <p:inputText value="#{viewComp.description}" /> </p:inplace> <hr/> - <p:dataTable value="#{viewComp.displays}" var="disp"> + <p:dataTable value="#{viewComp.displayConnectors}" var="dispConn"> <p:column headerText="Plugin" style="text-align: center"> - #{disp.parent.name} + #{dispConn.display.parent.name} </p:column> <p:column headerText="Display Name" style="text-align: center"> - #{disp.name} + #{dispConn.display.name} </p:column> <p:column headerText="Name" style="text-align: center"> - TODO + <p:inplace id="basic" editor="true"> + <p:inputText value="#{dispConn.name}" validator="#{currentCockpitEditorBean.validateDisplayConnectorName}" /> + </p:inplace> </p:column> <p:column style="text-align: center; width: 50px" > - <p:commandButton icon="ui-icon-trash"/> + <p:commandButton icon="ui-icon-trash" disabled="true"/> </p:column> </p:dataTable> </p:tab> @@ -101,6 +102,20 @@ </p:layoutUnit> </p:layout> + <p:dialog header="Save Project" resizable="false" modal="true" widgetVar="forceSaveDlg"> + <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="#{currentCockpitEditorBean.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> + <p:growl id="messages" life="1500" showDetail="true" autoUpdate="false" sticky="true"/> <!-- Include the dialog for the configuration. --> diff --git a/Kieker.WebGUI/src/main/webapp/Controller.xhtml b/Kieker.WebGUI/src/main/webapp/Controller.xhtml index 4e04256069f94a46072ec37a2e7d390afd9bf932..02631cda8cccc6007230f5ba9ea0162054e724c8 100644 --- a/Kieker.WebGUI/src/main/webapp/Controller.xhtml +++ b/Kieker.WebGUI/src/main/webapp/Controller.xhtml @@ -25,13 +25,13 @@ <h:outputText styleClass="kieker-title" value="Kieker » #{stringBean.shortenLongName(currentAnalysisEditorBean.projectName, 30)}"/> </p:toolbarGroup> <p:toolbarGroup align="right"> - <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="ProjectOverview.xhtml"/> + <p:commandButton styleClass="perspective-button" icon="ui-icon-home" action="#{currentControllerBean.clearProject()}"/> <p:separator/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" ajax="false" action="#{currentAnalysisEditorBean.setProject(currentControllerBean.projectName)}"/> + <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" ajax="false" action="#{forwardBean.forward(currentControllerBean, currentAnalysisEditorBean)}"/> <p:commandButton styleClass="perspective-button" icon="ui-icon-circle-triangle-e" value="Analysis" ajax="false" disabled="true" /> <p:separator/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" action="#{currentCockpitEditorBean.setProject(currentControllerBean.projectName)}" /> - <p:commandButton styleClass="perspective-button" icon="ui-icon-image" value="Cockpit" ajax="false" action="#{currentCockpitBean.setProject(currentControllerBean.projectName)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" action="#{forwardBean.forward(currentControllerBean, currentCockpitEditorBean)}" /> + <p:commandButton styleClass="perspective-button" icon="ui-icon-image" value="Cockpit" ajax="false" action="#{forwardBean.forward(currentControllerBean, currentCockpitBean)}" /> </p:toolbarGroup> </p:toolbar> diff --git a/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml b/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml index 8542d3cdaf14892d7a25b2f63967196cf0e7e270..11543e6a5fa961245be112488d86a03d9061d8d5 100644 --- a/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml +++ b/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml @@ -22,7 +22,7 @@ <p:toolbarGroup align="right"> <p:commandButton styleClass="perspective-button" icon="ui-icon-home" disabled="true" action="ProjectOverview.xhtml" /> <p:separator/> - <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" ajax="false" action="#{currentAnalysisEditorBean.setProject(currentProjectOverviewBean.projectName)}"/> + <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Analysis Editor" style="white-space: none" ajax="false" action="#{currentAnalysisEditorBean.setProject(currentProjectOverviewBean.projectName)}" /> <p:commandButton styleClass="perspective-button" icon="ui-icon-circle-triangle-e" value="Analysis" ajax="false" action="#{currentControllerBean.setProject(currentProjectOverviewBean.projectName)}" /> <p:separator/> <p:commandButton styleClass="perspective-button" icon="ui-icon-wrench" value="Cockpit Editor" ajax="false" action="#{currentCockpitEditorBean.setProject(currentProjectOverviewBean.projectName)}" /> diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/aboutDialog.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/aboutDialog.xhtml index f29891490faf6736b3e11feb0c39d08853ca3e4c..622a4bac620d1772be885f2b4e92650ddb7ecdc1 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/aboutDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/aboutDialog.xhtml @@ -1,14 +1,14 @@ +<?xml version='1.0' encoding='UTF-8' ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <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="About..." resizable="false" modal="true" - widgetVar="aboutDlg" id="aboutDialog"> + <p:dialog header="About..." resizable="false" modal="true" widgetVar="aboutDlg"> <h:form> - <img src="../img/kieker-logo-transparent.png" /> + <img src="../img/kieker-logo-transparent.png" alt="Kieker-Logo" width="491" height="150" /> <hr/> <h:outputText value="Kieker.WebGUI" /> <br /> diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/forceSaveDialog.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/forceSaveDialog.xhtml deleted file mode 100644 index 678ff5c3d059b5b142e4e816e51df10f4635159d..0000000000000000000000000000000000000000 --- a/Kieker.WebGUI/src/main/webapp/dialogs/forceSaveDialog.xhtml +++ /dev/null @@ -1,22 +0,0 @@ -<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