Commit c3ec6a4b authored by Florian's avatar Florian

refactored analysis plugin

parent 7c6606d3
......@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Kieker-Analysis
Bundle-SymbolicName: kieker.tools.eclipse.analysis;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: plugin.TreeViewerPlugin
Bundle-Activator: kieker.tools.eclipse.analysis.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui,
......
......@@ -3,4 +3,5 @@ output.. = target/classes/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/
icons/,\
resources/
......@@ -4,22 +4,22 @@
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="handlers.SampleHandler"
id="eclipse-vizualisation.handlers.SampleHandler"
defaultHandler="kieker.tools.eclipse.analysis.handlers.SampleHandler"
id="kieker.tools.eclipse.analysis.handlers.SampleHandler"
name="CallTreeView"></command>
</extension>
<extension
point="org.eclipse.ui.views">
<category
name="Tree Category"
id="view">
name="Kieker"
id="kieker.tools.eclipse.kieker">
</category>
<view
allowMultiple="false"
category="view"
class="view.TreeView"
class="kieker.tools.eclipse.analysis.view.TreeView"
icon="icons/sample.gif"
id="view.TreeView"
id="kieker.tools.eclipse.analysis.view.TreeView"
name="TreeView">
</view>
</extension>
......@@ -27,8 +27,8 @@
name="Handler"
point="org.eclipse.ui.handlers">
<handler
class="handlers.SampleHandler"
commandId="eclipse-vizualisation.commands.sampleCommand">
class="kieker.tools.eclipse.analysis.handlers.SampleHandler"
commandId="kieker.tools.eclipse.analysis.commands.sampleCommand">
</handler>
</extension>
......@@ -38,17 +38,8 @@
<menuContribution
locationURI="popup:org.eclipse.jdt.ui.PackageExplorer?after=additions">
<command
commandId="eclipse-vizualisation.commands.sampleCommand"
id="eclipse-vizualisation.menus.sampleCommand"
mnemonic="S"
label="Show TreeView">
</command>
</menuContribution>
<menuContribution
locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer">
<command
commandId="eclipse-vizualisation.commands.sampleCommand"
id="eclipse-vizualisation.menus.sampleCommand"
commandId="kieker.tools.eclipse.analysis.handlers.SampleHandler"
id="kieker.tools.eclipse.analysis.menus.sampleCommand"
mnemonic="S"
label="Show TreeView">
</command>
......
package plugin;
package kieker.tools.eclipse.analysis;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
public class TreeViewerPlugin extends AbstractUIPlugin {
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "eclipse-vizualisation"; //$NON-NLS-1$
public static final String PLUGIN_ID = "kieker.tools.eclipse.analysis"; //$NON-NLS-1$
public final static String PACKAGENAME = "kieker.tools.eclipse.analysis";
/**
* The constructor
*/
public TreeViewerPlugin() {
public Activator() {
}
/*
......
package handlers;
package kieker.tools.eclipse.analysis.handlers;
import java.util.Objects;
......@@ -12,8 +12,11 @@ import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
import kieker.tools.eclipse.analysis.Activator;
public class SampleHandler extends AbstractHandler {
private static final String TREEVIEW = Activator.PACKAGENAME + ".view.TreeView";
private Shell shell;
private IsKiekerLogFolderPropertyTester isLogFolder;
private IWorkbenchWindow window;
......@@ -50,7 +53,7 @@ public class SampleHandler extends AbstractHandler {
if (result) {
try {
HandlerUtil.getActiveWorkbenchWindow(event).getActivePage()
.showView("view.TreeView");
.showView(TREEVIEW);
} catch (PartInitException e) {
e.printStackTrace();
}
......
package provider;
package kieker.tools.eclipse.analysis.provider;
import model.Person;
import kieker.tools.eclipse.analysis.model.Person;
public class DataProvider {
......
package provider;
import model.Person;
package kieker.tools.eclipse.analysis.provider;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import kieker.tools.eclipse.analysis.model.Person;
/*
* TODO Start Stages here;
......
package provider;
package kieker.tools.eclipse.analysis.provider;
import java.io.IOException;
import java.io.InputStream;
......@@ -6,13 +6,13 @@ import java.net.URL;
import java.util.Enumeration;
import java.util.Properties;
import model.Person;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import kieker.tools.eclipse.analysis.model.Person;
public class MyTreeLabelProvider extends LabelProvider {
private final ImageRegistry ir;
......@@ -44,7 +44,7 @@ public class MyTreeLabelProvider extends LabelProvider {
// Create Image Registry from properties
private void createImageRegistry() {
Properties props = new Properties();
InputStream inStream = this.getClass().getClassLoader().getResourceAsStream("images.properties");
InputStream inStream = this.getClass().getClassLoader().getResourceAsStream("resources/images.properties");
try {
props.load(inStream);
inStream.close();
......
package view;
package kieker.tools.eclipse.analysis.view;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.Properties;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
......@@ -17,9 +11,10 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import provider.DataProvider;
import provider.MyTreeContentProvider;
import provider.MyTreeLabelProvider;
import kieker.tools.eclipse.analysis.provider.DataProvider;
import kieker.tools.eclipse.analysis.provider.MyTreeContentProvider;
import kieker.tools.eclipse.analysis.provider.MyTreeLabelProvider;
public class TreeView extends ViewPart {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment