Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WebGUI
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kieker
WebGUI
Commits
5c3ac9e1
Commit
5c3ac9e1
authored
13 years ago
by
nie
Browse files
Options
Downloads
Patches
Plain Diff
Added comments & context menu.
parent
b6aefb09
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Kieker.WebGUI/src/main/java/kieker/webgui/common/PluginFinder.java
+42
-16
42 additions, 16 deletions
...bGUI/src/main/java/kieker/webgui/common/PluginFinder.java
Kieker.WebGUI/src/main/webapp/main.xhtml
+16
-5
16 additions, 5 deletions
Kieker.WebGUI/src/main/webapp/main.xhtml
with
58 additions
and
21 deletions
Kieker.WebGUI/src/main/java/kieker/webgui/common/PluginFinder.java
+
42
−
16
View file @
5c3ac9e1
...
...
@@ -16,8 +16,24 @@ import kieker.analysis.plugin.port.Plugin;
*/
public
class
PluginFinder
{
public
static
List
<
Class
<?>>
getAllPluginsWithinJar
(
final
URL
url
)
throws
IOException
{
final
ClassLoader
classLoader
=
new
URLClassLoader
(
new
URL
[]{
url
});
/**
* This method delivers all classes which are available in the given jar and
* has the Plugin-Annotation from the Kieker framework.
*
* @param url The url for the jar.
* @return A list containing all available plugin-classes or null, if an
* exception occured.
*/
public
static
List
<
Class
<?>>
getAllPluginsWithinJar
(
final
URL
url
)
{
try
{
/*
* Get a classloader and make sure that it has the system class
* loader as parent and that it knows the url.
*/
final
ClassLoader
classLoader
=
new
URLClassLoader
(
new
URL
[]{
url
},
ClassLoader
.
getSystemClassLoader
());
/*
* Open the jar file and run through all entries within this file.
*/
final
JarFile
jarFile
=
new
JarFile
(
new
File
(
url
.
getPath
()));
final
List
<
Class
<?>>
result
=
new
ArrayList
<
Class
<?>>();
Enumeration
<
JarEntry
>
jarEntries
=
jarFile
.
entries
();
...
...
@@ -27,7 +43,14 @@ public class PluginFinder {
String
name
=
jarEntry
.
toString
();
name
=
name
.
replace
(
'/'
,
'.'
);
name
=
name
.
replace
(
".class"
,
""
);
/*
* Try to find a class with the same name.
*/
Class
<?>
c
=
classLoader
.
loadClass
(
name
);
/*
* If it is a class and has the annotation - put it into our
* list.
*/
if
(
c
.
isAnnotationPresent
(
Plugin
.
class
))
{
result
.
add
(
c
);
}
...
...
@@ -35,5 +58,8 @@ public class PluginFinder {
}
}
return
result
;
}
catch
(
IOException
ex
)
{
return
null
;
}
}
}
This diff is collapsed.
Click to expand it.
Kieker.WebGUI/src/main/webapp/main.xhtml
+
16
−
5
View file @
5c3ac9e1
...
...
@@ -42,23 +42,34 @@
<p:submenu
label=
"Help"
>
<p:menuitem
value=
"About..."
onclick=
"AboutDialog.show();"
/>
</p:submenu>
</p:menubar>
</h:form>
</p:layoutUnit>
<!-- The following layout is at the left side of the page and shows the available projects. -->
<p:layoutUnit
style=
"font-size:15px"
header=
"Projects"
collapsible=
"true"
position=
"west"
size=
"200"
resizable=
"true"
minSize=
"100"
>
<h:form
id=
"ProjectsList"
>
<p:tree
selectionMode=
"single"
style=
"width: auto"
value=
"#{projectsBean.projectsRoot}"
var=
"node"
>
<p:tree
id=
"ProjectsListTree"
selectionMode=
"single"
style=
"width: auto"
value=
"#{projectsBean.projectsRoot}"
var=
"node"
>
<p:treeNode>
<h:outputText
value=
"#{node}"
/>
</p:treeNode>
</p:tree>
<p:contextMenu
style=
"font-size:15px"
for=
"ProjectsListTree"
>
<p:menuitem
value=
"Set as Main Project"
update=
"ProjectsList"
/>
<p:menuitem
value=
"Save Project"
update=
"ProjectsList"
/>
<p:separator/>
<p:menuitem
value=
"Delete Project"
/>
</p:contextMenu>
</h:form>
</p:layoutUnit>
<!-- The following layout unit is within the center and used for the graph. -->
<p:layoutUnit
position=
"center"
>
<p:layoutUnit
style=
"font-size:15px"
position=
"center"
>
</p:layoutUnit>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment