diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentWorkSpaceProjectBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentWorkSpaceProjectBean.java index b2460efe5e8758a1c60c74d4ee6f3d74c725da9a..8428d428cf4d171143047415ff08497638e0a476 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentWorkSpaceProjectBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentWorkSpaceProjectBean.java @@ -930,6 +930,48 @@ public final class CurrentWorkSpaceProjectBean { } } + /** + * Delivers the name of the currently selected plugin/repository. This is only necessary for the correct renaming of the components. + * + * @return The name of the plugin/repository. + */ + public String getCurrentPluginName() { + synchronized (this) { + if (this.selectedPlugin != null) { + return this.selectedPlugin.getName(); + } else { + return this.selectedRepository.getName(); + } + } + } + + /** + * Sets the name of the currently selected plugin/repository. This is only necessary for the correct renaming of the components. + * + * @param newName + * The new name of the plugin/repository. + */ + public void setCurrentPluginName(final String newName) { + synchronized (this) { + // Rename the plugin/repository and get the old name for the hash map + if (this.selectedPlugin != null) { + final String oldName = this.selectedPlugin.toString(); + final MIPlugin plugin = this.pluginMap.get(oldName); + this.selectedPlugin.setName(newName); + + // Update the hash map + this.pluginMap.put(plugin.toString(), plugin); + } else { + final String oldName = this.selectedRepository.toString(); + final MIRepository repository = this.repositoryMap.get(oldName); + this.selectedRepository.setName(newName); + + // Update the hash map + this.repositoryMap.put(repository.toString(), repository); + } + } + } + /** * Delivers the valid connections (between the filters) within the current main project. * diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml index b18b78434766a0c6d9c622574d4c60cc44c92a08..ad7d309de6e95bc013e721dda26730ead17a6124 100644 --- a/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml +++ b/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml @@ -110,7 +110,7 @@ </f:facet> <f:facet name="input"> <h:inputText value="#{property.value}" rendered="#{not stringBean.checkString(property)}"/> - <h:inputText value="#{currentWorkSpaceProjectBean.selectedPlugin.name}" rendered="#{stringBean.checkString(property)}"/> + <h:inputText value="#{currentWorkSpaceProjectBean.currentPluginName}" rendered="#{stringBean.checkString(property)}"/> </f:facet> </p:cellEditor> </p:column>