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 {
}
}
}
}
......@@ -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."));
}
}
}
......@@ -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.
*
......
......@@ -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>
<!-- ******************************************************************************** -->
......
......@@ -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 />
......
......@@ -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>
......
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