Commit 92889c11 authored by Florian's avatar Florian

In Op Call view it is now possible to jump to the corresponding OpCall in Traces view

parent b6b08e15
#Properties file for kieker.tools.eclipse.analysis
command.label.ShowInTraceTab = Zeige in Traces Tab
command.label.ShowTraces = Zeige Traces
command.label.ShowAggregatedTraces = Zeige aggregierte Traces
command.label.ShowOperationCalls = Zeige Methodenaufrufe
......
#Properties file for kieker.tools.eclipse.analysis
command.label.ShowInTraceTab = Show in Traces tab
command.label.ShowTraces = Show Traces
command.label.ShowAggregatedTraces = Show Aggregated Traces
command.label.ShowOperationCalls = Show Operation Calls
......
......@@ -27,6 +27,10 @@
id="kieker.tools.eclipse.analysis.commands.showMonitoringStatsCommand"
name="ShowMonitoringStats">
</command>
<command
id="kieker.tools.eclipse.analysis.commands.selectTraceFromOpCallCommand"
name="SelectTraceFromOpCall">
</command>
</extension>
<extension
point="org.eclipse.ui.views">
......@@ -35,7 +39,7 @@
id="kieker.tools.eclipse.kieker">
</category>
<view
allowMultiple="true"
allowMultiple="false"
category="kieker.tools.eclipse.kieker"
class="kieker.tools.eclipse.analysis.view.AnalysisTreeView"
icon="resources/kieker16.png"
......@@ -149,6 +153,10 @@
</with>
</enabledWhen>
</handler>
<handler
class="kieker.tools.eclipse.analysis.handler.SelectTraceFromOpCallHandler"
commandId="kieker.tools.eclipse.analysis.commands.selectTraceFromOpCallCommand">
</handler>
</extension>
<extension
......@@ -204,6 +212,24 @@
label="%command.label.OpenFileInEditor"
style="push">
</command>
<command
commandId="kieker.tools.eclipse.analysis.commands.selectTraceFromOpCallCommand"
label="%command.label.ShowInTraceTab"
style="push">
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<iterate
operator="and">
<test
forcePluginActivation="true"
property="kieker.tools.eclipse.analysis.helper.opCallTabTester.checkTab">
</test>
</iterate>
</with>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension
......@@ -215,6 +241,13 @@
properties="checkFolder"
type="org.eclipse.core.resources.IResource">
</propertyTester>
<propertyTester
class="kieker.tools.eclipse.analysis.helper.OpCallTabTester"
id="kieker.tools.eclipse.analysis.helper.opCallTabTester"
namespace="kieker.tools.eclipse.analysis.helper.opCallTabTester"
properties="checkTab"
type="kieker.analysis.domain.OperationCall">
</propertyTester>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
......
package kieker.tools.eclipse.analysis.handler;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
import kieker.analysis.domain.OperationCall;
import kieker.tools.eclipse.analysis.view.AnalysisTreeView;
public class SelectTraceFromOpCallHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
try {
IViewPart partView = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage()
.showView(AnalysisTreeView.VIEWNAME);
ISelection sel = HandlerUtil.getCurrentSelection(event);
if (sel instanceof IStructuredSelection) {
Object selected= ((IStructuredSelection) sel).getFirstElement();
if (selected instanceof OperationCall) {
OperationCall opCall = (OperationCall) selected;
List<Object> path = new ArrayList<>();
path.add(opCall);
if (partView instanceof AnalysisTreeView) {
AnalysisTreeView view = (AnalysisTreeView) partView;
List<ColumnViewer> viewer = view.getViewerList();
ColumnViewer colView = viewer.get(0);
colView.setSelection(new TreeSelection(new TreePath(path.toArray())), true);
view.setFocus(0);
}
}
}
} catch (PartInitException e) {
e.printStackTrace();
}
return null;
}
}
package kieker.tools.eclipse.analysis.helper;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PlatformUI;
import kieker.analysis.domain.OperationCall;
import kieker.tools.eclipse.analysis.view.AnalysisTreeView;
/**
* @author Florian Echternkamp
*/
public class OpCallTabTester extends PropertyTester {
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if ("checkTab".equals(property)) {
if (receiver instanceof OperationCall) {
IViewPart analysisView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.findView(AnalysisTreeView.VIEWNAME);
if (analysisView instanceof AnalysisTreeView) {
AnalysisTreeView view = (AnalysisTreeView) analysisView;
TabFolder tabFolder = view.getTabFolder();
if (tabFolder.getSelectionIndex() == AnalysisTreeView.OPCALLTAB) {
return true;
}
}
}
}
return false;
}
}
......@@ -64,9 +64,17 @@ public class AnalysisTreeView extends AbstractJFaceView {
TabFolder tabFolder;
public TabFolder getTabFolder() {
return tabFolder;
}
List<TabItem> tabList = new ArrayList<>();
List<ColumnViewer> viewerList = new ArrayList<>();
public List<ColumnViewer> getViewerList() {
return viewerList;
}
SelectionProviderIntermediate selIntermediate;
public void createPartControl(Composite parent) {
......
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