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

Modified the tool palette.

parent dad45b5f
No related branches found
No related tags found
No related merge requests found
...@@ -175,5 +175,5 @@ public class AvailableProjectsBean { ...@@ -175,5 +175,5 @@ public class AvailableProjectsBean {
} }
} }
} }
} }
...@@ -95,10 +95,10 @@ public class SelectedDependenciesBean { ...@@ -95,10 +95,10 @@ public class SelectedDependenciesBean {
if (this.project != null) { if (this.project != null) {
this.project.getDependencies().clear(); this.project.getDependencies().clear();
this.project.getDependencies().addAll(this.dependencies); 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 { } 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."));
} }
} }
} }
...@@ -22,6 +22,7 @@ package kieker.webgui.beans.session; ...@@ -22,6 +22,7 @@ package kieker.webgui.beans.session;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.faces.application.FacesMessage; import javax.faces.application.FacesMessage;
...@@ -41,8 +42,7 @@ import org.primefaces.model.DefaultTreeNode; ...@@ -41,8 +42,7 @@ import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.TreeNode; import org.primefaces.model.TreeNode;
/** /**
* This bean can be used to store the currently selected project and the current * This bean can be used to store the currently selected project and the current main project for the user within a session.
* main project for the user within a session.
* *
* @author Nils Christian Ehmke * @author Nils Christian Ehmke
* @version 1.0 * @version 1.0
...@@ -68,7 +68,9 @@ public class SelectedProjectBean { ...@@ -68,7 +68,9 @@ public class SelectedProjectBean {
* Creates a new instance of this class. * Creates a new instance of this class.
*/ */
public SelectedProjectBean() { public SelectedProjectBean() {
/* No code necessary. */ /*
* No code necessary.
*/
} }
/** /**
...@@ -120,13 +122,10 @@ public class SelectedProjectBean { ...@@ -120,13 +122,10 @@ public class SelectedProjectBean {
} }
/** /**
* This event should be triggered once a new node is selected * This event should be triggered once a new node is selected to make sure that the newly selected node is stored within this bean.
* to make sure that the newly selected node is stored within
* this bean.
* *
* @param event * @param event
* The event that a node has been selected by the * The event that a node has been selected by the user.
* user.
*/ */
public final void onNodeSelect(final NodeSelectEvent event) { public final void onNodeSelect(final NodeSelectEvent event) {
this.setSelectedNode(event.getTreeNode()); this.setSelectedNode(event.getTreeNode());
...@@ -148,9 +147,7 @@ public class SelectedProjectBean { ...@@ -148,9 +147,7 @@ public class SelectedProjectBean {
} }
/** /**
* Delivers the "font weight" (whether the font is bold or normal) for a * 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.
* given project. This can be especially be used to mark a selected main
* project.
* *
* @param project * @param project
* The project to be checked. * The project to be checked.
...@@ -164,6 +161,65 @@ public class SelectedProjectBean { ...@@ -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. * Delivers the available plugins.
* *
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<link rel="stylesheet" type="text/css" href="../main.css" /> <link rel="stylesheet" type="text/css" href="../main.css" />
</h:head> </h:head>
<h:body onload="initPageObjects();"> <h:body>
<!-- This is the layout for the whole page. --> <!-- This is the layout for the whole page. -->
<p:layout id="layout" fullPage="true"> <p:layout id="layout" fullPage="true">
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</p:submenu> </p:submenu>
<p:submenu label="Help"> <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:submenu>
</p:menubar> </p:menubar>
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<!-- ******************************************************************************** --> <!-- ******************************************************************************** -->
<!-- The following layout unit is within the center and used for the graph. --> <!-- 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> </p:layoutUnit>
<!-- ******************************************************************************** --> <!-- ******************************************************************************** -->
...@@ -145,31 +145,18 @@ ...@@ -145,31 +145,18 @@
<p:layoutUnit position="east" size="200" header="Tool Palette" <p:layoutUnit position="east" size="200" header="Tool Palette"
resizable="true" collapsible="true"> resizable="true" collapsible="true">
<h:form id="toolpalette"> <h:form id="toolpalette">
<p:tree style="width: auto" value="#{selectedProjectBean.availablePluginsRoot}" dynamic="true" var="node"> <p:accordionPanel multiple="true" activeIndex="">
<p:tab title="Reader">
<p:treeNode type="default"> <ui:repeat value="#{selectedProjectBean.availableReaders}" var="reader">
<h:outputText value="#{node}"/> <p:commandLink value="#{reader.simpleName}"/><br/>
</p:treeNode> </ui:repeat>
<p:treeNode type="reader" icon="ui-icon-folder-open"> </p:tab>
<h:form> <p:tab title="Filter">
<p:commandLink ajax="true"> <ui:repeat value="#{selectedProjectBean.availableFilters}" var="filter">
<h:outputText value="#{node}"> <p:commandLink value="#{filter.simpleName}"/><br/>
<f:converter converterId="kieker.webgui.converter.ClassToStringConverter"/> </ui:repeat>
</h:outputText> </p:tab>
</p:commandLink> </p:accordionPanel>
</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>
</h:form> </h:form>
</p:layoutUnit> </p:layoutUnit>
<!-- ******************************************************************************** --> <!-- ******************************************************************************** -->
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<!-- ******************************************************************************** --> <!-- ******************************************************************************** -->
<!-- This is the about-dialog. --> <!-- This is the about-dialog. -->
<p:dialog header="About..." resizable="false" modal="true" <p:dialog header="About..." resizable="false" modal="true"
widgetVar="AboutDialog"> widgetVar="aboutDialog" id="aboutDialog">
<h:form> <h:form>
<h:outputText value="Kieker.WebGUI" /> <h:outputText value="Kieker.WebGUI" />
<br /> <br />
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<f:facet name="header"> <f:facet name="header">
</f:facet> </f:facet>
<div align="center"> <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)}"/> action="#{availableDependenciesBean.deleteDependency(dependency)}"/>
</div> </div>
</p:column> </p:column>
......
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