diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java index d5bba71540fd72e0f9750791375b379bb548b819..295b777c521fc30b816bf5ccef5375a7a0d80621 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java @@ -175,5 +175,5 @@ public class AvailableProjectsBean { } } } - + } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/SelectedDependenciesBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/SelectedDependenciesBean.java index cf00728bd65e965e374437fe4037a6e9061a121d..14f57c5d2b2f8b4b781ea6b6030bec78afd678d4 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/SelectedDependenciesBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/SelectedDependenciesBean.java @@ -95,10 +95,10 @@ public class SelectedDependenciesBean { if (this.project != null) { this.project.getDependencies().clear(); this.project.getDependencies().addAll(this.dependencies); - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "", "Dependencies saved.")); + FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "", "Dependencies saved.")); } else { - FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "", "No project selected.")); - } + FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "", "No project selected.")); + } } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/SelectedProjectBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/SelectedProjectBean.java index 3440e25cea29952368c778c35c7ae3deb4b09750..ea6db00ce135ac6e69b636f830ffe830b597aefd 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/SelectedProjectBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/SelectedProjectBean.java @@ -22,6 +22,7 @@ package kieker.webgui.beans.session; import java.lang.reflect.Modifier; import java.net.MalformedURLException; import java.net.URL; +import java.util.ArrayList; import java.util.List; import javax.faces.application.FacesMessage; @@ -41,8 +42,7 @@ import org.primefaces.model.DefaultTreeNode; import org.primefaces.model.TreeNode; /** - * This bean can be used to store the currently selected project and the current - * main project for the user within a session. + * This bean can be used to store the currently selected project and the current main project for the user within a session. * * @author Nils Christian Ehmke * @version 1.0 @@ -68,7 +68,9 @@ public class SelectedProjectBean { * Creates a new instance of this class. */ public SelectedProjectBean() { - /* No code necessary. */ + /* + * No code necessary. + */ } /** @@ -120,13 +122,10 @@ public class SelectedProjectBean { } /** - * This event should be triggered once a new node is selected - * to make sure that the newly selected node is stored within - * this bean. + * This event should be triggered once a new node is selected to make sure that the newly selected node is stored within this bean. * * @param event - * The event that a node has been selected by the - * user. + * The event that a node has been selected by the user. */ public final void onNodeSelect(final NodeSelectEvent event) { this.setSelectedNode(event.getTreeNode()); @@ -148,9 +147,7 @@ public class SelectedProjectBean { } /** - * Delivers the "font weight" (whether the font is bold or normal) for a - * given project. This can be especially be used to mark a selected main - * project. + * Delivers the "font weight" (whether the font is bold or normal) for a given project. This can be especially be used to mark a selected main project. * * @param project * The project to be checked. @@ -164,6 +161,65 @@ public class SelectedProjectBean { } } + public final List<Class<?>> getAvailableReaders() { + final List<Class<?>> list = new ArrayList<Class<?>>(); + + if (this.mainProject != null) { + for (final MIDependency lib : this.mainProject.getDependencies()) { + try { + PluginClassLoader.getInstance().addURL(new URL("file", "localhost", lib.getFilePath())); + } catch (final MalformedURLException ex) { + // TODO Log exception + } + try { + final List<Class<?>> plugins = PluginFinder.getAllPluginsWithinJar(new URL("file", "localhost", lib.getFilePath())); + for (final Class<?> plugin : plugins) { + if (!Modifier.isAbstract(plugin.getModifiers())) { + if (AbstractReaderPlugin.class.isAssignableFrom(plugin)) { + list.add(plugin); + } + } + } + } catch (final MalformedURLException ex) { + ex.printStackTrace(); + // TODO Log exception + } + } + } + + return list; + } + + public final List getAvailableFilters() { + final List<Class<?>> list = new ArrayList<Class<?>>(); + + if (this.mainProject != null) { + for (final MIDependency lib : this.mainProject.getDependencies()) { + try { + PluginClassLoader.getInstance().addURL(new URL("file", "localhost", lib.getFilePath())); + } catch (final MalformedURLException ex) { + // TODO Log exception + } + try { + final List<Class<?>> plugins = PluginFinder.getAllPluginsWithinJar(new URL("file", "localhost", lib.getFilePath())); + for (final Class<?> plugin : plugins) { + if (!Modifier.isAbstract(plugin.getModifiers())) { + if (AbstractAnalysisPlugin.class.isAssignableFrom(plugin)) { + list.add(plugin); + } + } + } + } catch (final MalformedURLException ex) { + ex.printStackTrace(); + // TODO Log exception + } + } + } + + return list; + + } + /** * Delivers the available plugins. * diff --git a/Kieker.WebGUI/src/main/webapp/main.xhtml b/Kieker.WebGUI/src/main/webapp/main.xhtml index deef92c3933189dc3062c02406a3d6d70d277160..b48b150b4b43483a3f00ed92484bcc1156b7e4a2 100644 --- a/Kieker.WebGUI/src/main/webapp/main.xhtml +++ b/Kieker.WebGUI/src/main/webapp/main.xhtml @@ -12,7 +12,7 @@ <link rel="stylesheet" type="text/css" href="../main.css" /> </h:head> - <h:body onload="initPageObjects();"> + <h:body> <!-- This is the layout for the whole page. --> <p:layout id="layout" fullPage="true"> @@ -40,7 +40,7 @@ </p:submenu> <p:submenu label="Help"> - <p:menuitem value="About..." ajax="true" onclick="AboutDialog.show();" /> + <p:menuitem value="About..." ajax="true" onclick="aboutDialog.show()" /> </p:submenu> </p:menubar> @@ -100,7 +100,7 @@ <!-- ******************************************************************************** --> <!-- The following layout unit is within the center and used for the graph. --> - <p:layoutUnit position="center"> + <p:layoutUnit position="center" id="centerLayout"> </p:layoutUnit> <!-- ******************************************************************************** --> @@ -145,31 +145,18 @@ <p:layoutUnit position="east" size="200" header="Tool Palette" resizable="true" collapsible="true"> <h:form id="toolpalette"> - <p:tree style="width: auto" value="#{selectedProjectBean.availablePluginsRoot}" dynamic="true" var="node"> - - <p:treeNode type="default"> - <h:outputText value="#{node}"/> - </p:treeNode> - <p:treeNode type="reader" icon="ui-icon-folder-open"> - <h:form> - <p:commandLink ajax="true"> - <h:outputText value="#{node}"> - <f:converter converterId="kieker.webgui.converter.ClassToStringConverter"/> - </h:outputText> - </p:commandLink> - </h:form> - </p:treeNode> - - <p:treeNode type="filter" icon="ui-icon-disk"> - <h:form> - <p:commandLink> - <h:outputText value="#{node}" > - <f:converter converterId="kieker.webgui.converter.ClassToStringConverter"/> - </h:outputText> - </p:commandLink> - </h:form> - </p:treeNode> - </p:tree> + <p:accordionPanel multiple="true" activeIndex=""> + <p:tab title="Reader"> + <ui:repeat value="#{selectedProjectBean.availableReaders}" var="reader"> + <p:commandLink value="#{reader.simpleName}"/><br/> + </ui:repeat> + </p:tab> + <p:tab title="Filter"> + <ui:repeat value="#{selectedProjectBean.availableFilters}" var="filter"> + <p:commandLink value="#{filter.simpleName}"/><br/> + </ui:repeat> + </p:tab> + </p:accordionPanel> </h:form> </p:layoutUnit> <!-- ******************************************************************************** --> diff --git a/Kieker.WebGUI/src/main/webapp/main/aboutDialog.xhtml b/Kieker.WebGUI/src/main/webapp/main/aboutDialog.xhtml index 38dc4a6516f3d0d8e3cae3dc5fae268c3975ca18..a109c34d696d0a95f08845c88e0bc7ebff2ef8dd 100644 --- a/Kieker.WebGUI/src/main/webapp/main/aboutDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/main/aboutDialog.xhtml @@ -8,7 +8,7 @@ <!-- ******************************************************************************** --> <!-- This is the about-dialog. --> <p:dialog header="About..." resizable="false" modal="true" - widgetVar="AboutDialog"> + widgetVar="aboutDialog" id="aboutDialog"> <h:form> <h:outputText value="Kieker.WebGUI" /> <br /> diff --git a/Kieker.WebGUI/src/main/webapp/manageDependencies.xhtml b/Kieker.WebGUI/src/main/webapp/manageDependencies.xhtml index d37c663d204812f41c59b0671406c1af5fe1c01a..29b158d4974cf73f78910cb01819fcf91fe0b941 100644 --- a/Kieker.WebGUI/src/main/webapp/manageDependencies.xhtml +++ b/Kieker.WebGUI/src/main/webapp/manageDependencies.xhtml @@ -63,7 +63,7 @@ <f:facet name="header"> </f:facet> <div align="center"> - <p:commandButton ajax="true" update="currentDependenciesForm" icon="ui-icon-trash" title="Delete" + <p:commandButton ajax="true" update=":currentDependenciesForm" icon="ui-icon-trash" title="Delete" action="#{availableDependenciesBean.deleteDependency(dependency)}"/> </div> </p:column>