Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
184f1b2d2c | |||
90249dadb9 | |||
d47db29b93 | |||
e8148af10f | |||
b298a4ca6c | |||
f474e38687 | |||
2e806f7b86 |
@ -20,6 +20,13 @@
|
||||
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.15/"/>
|
||||
<unit id="org.codehaus.groovy25.feature.feature.group" version="0.0.0"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<repository location="http://download.eclipse.org/nattable/releases/1.6.0/repository/"/>
|
||||
<unit id="org.eclipse.nebula.widgets.nattable.core.feature.feature.group" version="1.6.0.201909181823"/>
|
||||
<unit id="org.eclipse.nebula.widgets.nattable.extension.e4.feature.feature.group" version="1.2.0.201909181823"/>
|
||||
<unit id="org.eclipse.nebula.widgets.nattable.extension.glazedlists.feature.feature.group" version="1.6.0.201909181823"/>
|
||||
<unit id="org.eclipse.nebula.widgets.nattable.extension.poi.feature.feature.group" version="1.5.1.201909181823"/>
|
||||
</location>
|
||||
</locations>
|
||||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<launcherArgs>
|
||||
|
@ -1,2 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
pluginProject.extensions=false
|
||||
resolve.requirebundle=false
|
||||
|
@ -54,6 +54,7 @@
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_JTXBgYl_EeWxJ_wPkM6yGQ" elementId="" label="Preferences" command="_AxH6sIl_EeWxJ_wPkM6yGQ"/>
|
||||
</children>
|
||||
<children xsi:type="menu:Menu" xmi:id="_95QGxHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.menu.help" label="Help">
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_UQRi0B07EeuiP60JNw0iiA" elementId="com.minres.scviewer.e4.application.handledmenuitem.checkforupdate" visible="false" label="Check for Update" enabled="false" command="_-9ED4B06EeuiP60JNw0iiA"/>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_95QGxXNmEeWBq8z1Dv39LA" label="About" command="_95PfxnNmEeWBq8z1Dv39LA"/>
|
||||
</children>
|
||||
</mainMenu>
|
||||
@ -137,6 +138,7 @@
|
||||
<handlers xmi:id="_x4pSEGtTEeqmlpoaaMHoiw" elementId="com.minres.scviewer.e4.application.handler.0" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.EnableHover" command="_uyeyYGtTEeqmlpoaaMHoiw"/>
|
||||
<handlers xmi:id="_h3jU8BkWEeudD5MqrWoETQ" elementId="com.minres.scviewer.e4.application.handler.reloadCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ReloadHandler" command="_srACsBkREeudD5MqrWoETQ"/>
|
||||
<handlers xmi:id="_gn_boBlEEeuiP60JNw0iiA" elementId="com.minres.scviewer.e4.application.handler.txSearch" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.SearchHandler" command="_XDxTYBlEEeuiP60JNw0iiA"/>
|
||||
<handlers xmi:id="_CCEtAB07EeuiP60JNw0iiA" elementId="com.minres.scviewer.e4.application.handler.update" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.UpdateHandler" command="_-9ED4B06EeuiP60JNw0iiA"/>
|
||||
<bindingTables xmi:id="_95PfvnNmEeWBq8z1Dv39LA" bindingContext="_95PfuXNmEeWBq8z1Dv39LA">
|
||||
<bindings xmi:id="_95Pfv3NmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.keybinding.quit" keySequence="M1+Q" command="_95PfvHNmEeWBq8z1Dv39LA">
|
||||
<tags>type:user</tags>
|
||||
@ -277,6 +279,7 @@
|
||||
<commands xmi:id="_uyeyYGtTEeqmlpoaaMHoiw" elementId="com.minres.scviewer.e4.application.command.enablehover" commandName="Enable hover" description="Enable hover window in waveform"/>
|
||||
<commands xmi:id="_srACsBkREeudD5MqrWoETQ" elementId="com.minres.scviewer.e4.application.reload" commandName="Reload Command"/>
|
||||
<commands xmi:id="_XDxTYBlEEeuiP60JNw0iiA" elementId="com.minres.scviewer.e4.application.txSearch" commandName="Search Command"/>
|
||||
<commands xmi:id="_-9ED4B06EeuiP60JNw0iiA" elementId="com.minres.scviewer.e4.application.command.update" commandName="Update"/>
|
||||
<addons xmi:id="_95PfsnNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
|
||||
<addons xmi:id="_95Pfs3NmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
|
||||
<addons xmi:id="_95PftHNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
|
||||
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
||||
Bundle-Version: 2.9.0.qualifier
|
||||
Bundle-Version: 2.9.2.qualifier
|
||||
Bundle-Vendor: %Bundle-Vendor
|
||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
org.eclipse.core.runtime;bundle-version="3.11.1",
|
||||
@ -31,7 +31,11 @@ Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
org.eclipse.core.resources;bundle-version="3.13.0",
|
||||
javax.annotation;bundle-version="1.2.0",
|
||||
org.eclipse.core.databinding,
|
||||
org.eclipse.jface.databinding
|
||||
org.eclipse.jface.databinding,
|
||||
org.eclipse.equinox.p2.core;bundle-version="2.6.300",
|
||||
org.eclipse.equinox.p2.engine;bundle-version="2.6.600",
|
||||
org.eclipse.equinox.p2.operations;bundle-version="2.5.700",
|
||||
org.eclipse.equinox.p2.metadata.repository;bundle-version="1.3.400"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Import-Package: com.minres.scviewer.database,
|
||||
javax.inject;version="1.0.0"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>com.minres.scviewer.e4.application</artifactId>
|
||||
<version>2.9.0-SNAPSHOT</version>
|
||||
<version>2.9.2-SNAPSHOT</version>
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
package com.minres.scviewer.e4.application.handlers;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.ui.di.UISynchronize;
|
||||
import org.eclipse.e4.ui.workbench.IWorkbench;
|
||||
import org.eclipse.equinox.p2.core.IProvisioningAgent;
|
||||
import org.eclipse.equinox.p2.operations.ProvisioningSession;
|
||||
import org.eclipse.equinox.p2.operations.UpdateOperation;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
|
||||
public class UpdateHandler {
|
||||
@Execute
|
||||
public void execute(IProvisioningAgent agent, UISynchronize synchronize, IWorkbench workbench) {
|
||||
ProvisioningSession session = new ProvisioningSession(agent);
|
||||
UpdateOperation operation = new UpdateOperation(session);
|
||||
IStatus status = operation.resolveModal(null);
|
||||
if(status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) {
|
||||
MessageDialog.openInformation(null, "Information", "Nothing to update");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -137,7 +137,6 @@ public class TransactionDetails {
|
||||
|
||||
treeViewer = new TreeViewer(top);
|
||||
treeViewer.setContentProvider(new AbstractTransactionTreeContentProvider(waveformViewerPart) {
|
||||
|
||||
@Override
|
||||
public Object[] getElements(Object element) {
|
||||
return new Object[]{
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.minres.scviewer.e4.application.parts;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
@ -13,11 +12,12 @@ import org.eclipse.jface.viewers.ComboViewer;
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
|
||||
import org.eclipse.jface.viewers.DoubleClickEvent;
|
||||
import org.eclipse.jface.viewers.IDoubleClickListener;
|
||||
import org.eclipse.jface.viewers.ITreeSelection;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.TreeViewerColumn;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.viewers.TableViewerColumn;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
@ -27,9 +27,10 @@ import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableColumn;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.swt.widgets.Tree;
|
||||
import org.eclipse.swt.widgets.TreeColumn;
|
||||
|
||||
import com.minres.scviewer.database.DataType;
|
||||
import com.minres.scviewer.database.ITx;
|
||||
@ -40,6 +41,8 @@ import com.minres.scviewer.database.ITxStream;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.e4.application.parts.txTableTree.AbstractTransactionTreeContentProvider;
|
||||
import com.minres.scviewer.e4.application.parts.txTableTree.AttributeLabelProvider;
|
||||
import com.minres.scviewer.e4.application.parts.txTableTree.TransactionTreeNode;
|
||||
import com.minres.scviewer.e4.application.parts.txTableTree.TransactionTreeNodeType;
|
||||
import com.minres.scviewer.e4.application.parts.txTableTree.TxFilter;
|
||||
|
||||
public class TransactionList extends Composite {
|
||||
@ -72,11 +75,11 @@ public class TransactionList extends Composite {
|
||||
|
||||
private Text searchPropValue;
|
||||
|
||||
private TreeViewer treeViewer = null;
|
||||
private TableViewer tableViewer = null;
|
||||
|
||||
private TreeColumn valueColumn = null;
|
||||
|
||||
private AttributeLabelProvider nameLabelProvider = null;
|
||||
private TableColumn valueColumn = null;
|
||||
|
||||
private AttributeLabelProvider valueLabelProvider = null;
|
||||
|
||||
private ITxStream<? extends ITxEvent> stream;
|
||||
|
||||
@ -95,9 +98,14 @@ public class TransactionList extends Composite {
|
||||
*/
|
||||
public TransactionList(Composite parent, int style, WaveformViewer waveformViewer) {
|
||||
super(parent, style);
|
||||
setLayout(new GridLayout(3, false));
|
||||
setLayout(new GridLayout(5, false));
|
||||
txFilter = new TxFilter();
|
||||
|
||||
Label lbl1 = new Label(this, SWT.NONE);
|
||||
lbl1.setAlignment(SWT.RIGHT);
|
||||
lbl1.setText("Property to match:");
|
||||
lbl1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
|
||||
|
||||
searchPropComboViewer = new ComboViewer(this, SWT.NONE);
|
||||
searchPropComboViewer.setLabelProvider(new LabelProvider() {
|
||||
public String getText(Object element) {
|
||||
@ -115,26 +123,34 @@ public class TransactionList extends Composite {
|
||||
int idx = searchPropCombo.getSelectionIndex();
|
||||
AttributeNameBean sel = attrNames.get(idx);
|
||||
txFilter.setSearchProp(sel.getName(), sel.getType());
|
||||
tableViewer.refresh();
|
||||
}
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
int idx = searchPropCombo.getSelectionIndex();
|
||||
AttributeNameBean sel = attrNames.get(idx);
|
||||
txFilter.setSearchProp(sel.getName(), sel.getType());
|
||||
tableViewer.refresh();
|
||||
}
|
||||
});
|
||||
|
||||
searchPropValue = new Text(this, SWT.BORDER);
|
||||
searchPropValue.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
|
||||
GridData gd_searchPropValue = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
|
||||
gd_searchPropValue.minimumWidth = 50;
|
||||
searchPropValue.setLayoutData(gd_searchPropValue);
|
||||
searchPropValue.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
txFilter.setSearchValue(((Text) e.widget).getText());
|
||||
treeViewer.refresh();
|
||||
//treeViewer.expandAll(false);
|
||||
tableViewer.refresh();
|
||||
}
|
||||
});
|
||||
|
||||
Label lbl2 = new Label(this, SWT.NONE);
|
||||
lbl2.setAlignment(SWT.RIGHT);
|
||||
lbl2.setText("Property to show:");
|
||||
lbl2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
|
||||
|
||||
viewPropComboViewer = new ComboViewer(this, SWT.NONE);
|
||||
viewPropComboViewer.setLabelProvider(new LabelProvider() {
|
||||
public String getText(Object element) {
|
||||
@ -150,87 +166,84 @@ public class TransactionList extends Composite {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
int idx = viewPropCombo.getSelectionIndex();
|
||||
AttributeNameBean sel = attrNames.get(idx);
|
||||
nameLabelProvider.setShowProp(sel.getName());
|
||||
treeViewer.refresh(true);
|
||||
valueLabelProvider.setShowProp(attrNames.get(idx).getName());
|
||||
tableViewer.refresh(true);
|
||||
}
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) { }
|
||||
});
|
||||
|
||||
treeViewer = new TreeViewer(this, SWT.BORDER);
|
||||
treeViewer.setContentProvider(new AbstractTransactionTreeContentProvider(waveformViewer) {
|
||||
tableViewer = new TableViewer(this);
|
||||
tableViewer.setContentProvider(new AbstractTransactionTreeContentProvider(waveformViewer) {
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object[] getElements(Object inputElement) {
|
||||
if (inputElement instanceof Object[]) {
|
||||
return (Object[]) inputElement;
|
||||
}
|
||||
if (inputElement instanceof Collection) {
|
||||
return ((Collection) inputElement).toArray();
|
||||
if (inputElement instanceof ArrayList<?>) {
|
||||
return ((ArrayList<ITx>) inputElement).stream().map(tx-> new TransactionTreeNode(tx, TransactionTreeNodeType.TX)).collect(Collectors.toList()).toArray();
|
||||
}
|
||||
return new Object[0];
|
||||
}
|
||||
});
|
||||
treeViewer.addFilter(txFilter);
|
||||
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
|
||||
tableViewer.addFilter(txFilter);
|
||||
tableViewer.addDoubleClickListener(new IDoubleClickListener() {
|
||||
@Override
|
||||
public void doubleClick(DoubleClickEvent event) {
|
||||
ITreeSelection treeSelection = treeViewer.getStructuredSelection();
|
||||
Object selected = treeSelection.getFirstElement();
|
||||
if(selected instanceof ITx){
|
||||
waveformViewer.setSelection(new StructuredSelection(selected));
|
||||
ISelection treeSelection = tableViewer.getSelection();
|
||||
if(treeSelection instanceof IStructuredSelection) {
|
||||
Object selected = ((IStructuredSelection)treeSelection).getFirstElement();
|
||||
if(selected instanceof ITx){
|
||||
waveformViewer.setSelection(new StructuredSelection(selected));
|
||||
} else if(selected instanceof TransactionTreeNode && ((TransactionTreeNode)selected).type == TransactionTreeNodeType.TX) {
|
||||
waveformViewer.setSelection(new StructuredSelection(((TransactionTreeNode)selected).element));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Tree tree = treeViewer.getTree();
|
||||
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
|
||||
Table table = tableViewer.getTable();
|
||||
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
|
||||
|
||||
TreeViewerColumn nameColumnViewer = new TreeViewerColumn(treeViewer, SWT.NONE);
|
||||
TreeColumn nameColumn = nameColumnViewer.getColumn();
|
||||
TableViewerColumn nameColumnViewer = new TableViewerColumn(tableViewer, SWT.NONE);
|
||||
TableColumn nameColumn = nameColumnViewer.getColumn();
|
||||
nameColumn.setWidth(200);
|
||||
nameColumn.setText("Tx ID");
|
||||
nameColumn.setResizable(true);
|
||||
nameColumnViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new AttributeLabelProvider(waveformViewer, AttributeLabelProvider.NAME)));
|
||||
|
||||
TreeViewerColumn timeColumnViewer = new TreeViewerColumn(treeViewer, SWT.NONE);
|
||||
TreeColumn timeColumn = timeColumnViewer.getColumn();
|
||||
TableViewerColumn timeColumnViewer = new TableViewerColumn(tableViewer, SWT.NONE);
|
||||
TableColumn timeColumn = timeColumnViewer.getColumn();
|
||||
timeColumn.setAlignment(SWT.RIGHT);
|
||||
timeColumn.setWidth(150);
|
||||
timeColumn.setText("Start time");
|
||||
timeColumn.setResizable(true);
|
||||
timeColumnViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new AttributeLabelProvider(waveformViewer, AttributeLabelProvider.TX_TIME)));
|
||||
|
||||
TreeViewerColumn typeColumnViewer = new TreeViewerColumn(treeViewer, SWT.NONE);
|
||||
TreeColumn typeColumn = typeColumnViewer.getColumn();
|
||||
typeColumn.setAlignment(SWT.RIGHT);
|
||||
typeColumn.setWidth(150);
|
||||
typeColumn.setText("Type");
|
||||
typeColumn.setResizable(true);
|
||||
typeColumnViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new AttributeLabelProvider(waveformViewer, AttributeLabelProvider.TYPE)));
|
||||
|
||||
TreeViewerColumn valueColumnViewer = new TreeViewerColumn(treeViewer, SWT.NONE);
|
||||
TableViewerColumn valueColumnViewer = new TableViewerColumn(tableViewer, SWT.NONE);
|
||||
valueColumn = valueColumnViewer.getColumn();
|
||||
valueColumn.setWidth(150);
|
||||
valueColumn.setText("Value");
|
||||
valueColumn.setText("Property Value");
|
||||
valueColumn.setResizable(true);
|
||||
nameLabelProvider= new AttributeLabelProvider(waveformViewer, AttributeLabelProvider.VALUE);
|
||||
valueColumnViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(nameLabelProvider));
|
||||
valueLabelProvider= new AttributeLabelProvider(waveformViewer, AttributeLabelProvider.VALUE);
|
||||
valueColumnViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(valueLabelProvider));
|
||||
|
||||
// Turn on the header and the lines
|
||||
tree.setHeaderVisible(true);
|
||||
tree.setLinesVisible(true);
|
||||
table.setHeaderVisible(true);
|
||||
table.setLinesVisible(true);
|
||||
new Label(this, SWT.NONE);
|
||||
new Label(this, SWT.NONE);
|
||||
new Label(this, SWT.NONE);
|
||||
new Label(this, SWT.NONE);
|
||||
new Label(this, SWT.NONE);
|
||||
}
|
||||
|
||||
public void setInput(TrackEntry trackEntry) {
|
||||
if(trackEntry==null || !trackEntry.isStream()) {
|
||||
attrNames.clear();
|
||||
treeViewer.setInput(emptyList);
|
||||
tableViewer.setInput(emptyList);
|
||||
} else {
|
||||
stream=trackEntry.getStream();
|
||||
treeViewer.setInput(emptyList);
|
||||
tableViewer.setInput(emptyList);
|
||||
new Thread() {
|
||||
private ConcurrentHashMap<String, DataType> propNames=new ConcurrentHashMap<String, DataType>();
|
||||
|
||||
@ -242,21 +255,22 @@ public class TransactionList extends Composite {
|
||||
}
|
||||
|
||||
public void run() {
|
||||
stream.getEvents().values().parallelStream().forEach(evtLst -> {
|
||||
evtLst.forEach(evt -> {
|
||||
if(evt.getType()==Type.BEGIN) {
|
||||
eventList.add(evt.getTransaction());
|
||||
for(ITxAttribute attr: evt.getTransaction().getAttributes()) {
|
||||
eventList = stream.getEvents().values().parallelStream()
|
||||
.flatMap(List::stream)
|
||||
.filter(evt -> evt.getType()==Type.BEGIN)
|
||||
.map(evt-> {
|
||||
ITx tx = evt.getTransaction();
|
||||
for(ITxAttribute attr: tx.getAttributes()) {
|
||||
propNames.put(attr.getName(), attr.getDataType());
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
eventList = eventList.parallelStream().sorted((t1, t2)-> t1.getBeginTime().compareTo(t2.getBeginTime())).collect(Collectors.toList());
|
||||
return tx;
|
||||
})
|
||||
.sorted((t1, t2)-> t1.getBeginTime().compareTo(t2.getBeginTime()))
|
||||
.collect(Collectors.toList());
|
||||
getDisplay().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
treeViewer.setInput(eventList);
|
||||
tableViewer.setInput(eventList);
|
||||
attrNames.clear();
|
||||
attrNames.addAll(getEntries());
|
||||
searchPropComboViewer.getCombo().select(0);
|
||||
@ -265,6 +279,7 @@ public class TransactionList extends Composite {
|
||||
searchPropComboViewer.setInput(attrNames);
|
||||
searchPropComboViewer.setSelection(new StructuredSelection(searchPropComboViewer.getElementAt(0)));
|
||||
}
|
||||
tableViewer.refresh(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -46,38 +46,39 @@ public abstract class AbstractTransactionTreeContentProvider implements ITreeCon
|
||||
@Override
|
||||
public Object[] getChildren(Object element) {
|
||||
if(element instanceof ITx) {
|
||||
return new Object[]{
|
||||
new TransactionTreeNode((ITx)element, TransactionTreeNodeType.ATTRS)
|
||||
};
|
||||
return new Object[]{new TransactionTreeNode((ITx)element, TransactionTreeNodeType.ATTRS)};
|
||||
} else if(element instanceof TransactionTreeNode){
|
||||
TransactionTreeNode propertyHolder=(TransactionTreeNode) element;
|
||||
if(propertyHolder.type == TransactionTreeNodeType.PROPS){
|
||||
TransactionTreeNode node=(TransactionTreeNode) element;
|
||||
switch(node.type) {
|
||||
case PROPS:
|
||||
return new Object[][]{
|
||||
{Messages.TransactionDetails_1, Messages.TransactionDetails_16, propertyHolder.element.getStream().getFullName()},
|
||||
{Messages.TransactionDetails_2, Messages.TransactionDetails_16, propertyHolder.element.getGenerator().getName()},
|
||||
{Messages.TransactionDetails_19, Messages.TransactionDetails_20, waveformViewerPart.getScaledTime(propertyHolder.element.getBeginTime())},
|
||||
{Messages.TransactionDetails_21, Messages.TransactionDetails_20, waveformViewerPart.getScaledTime(propertyHolder.element.getEndTime())}
|
||||
{Messages.TransactionDetails_1, Messages.TransactionDetails_16, node.element.getStream().getFullName()},
|
||||
{Messages.TransactionDetails_2, Messages.TransactionDetails_16, node.element.getGenerator().getName()},
|
||||
{Messages.TransactionDetails_19, Messages.TransactionDetails_20, waveformViewerPart.getScaledTime(node.element.getBeginTime())},
|
||||
{Messages.TransactionDetails_21, Messages.TransactionDetails_20, waveformViewerPart.getScaledTime(node.element.getEndTime())}
|
||||
};
|
||||
}else if(propertyHolder.type == TransactionTreeNodeType.ATTRS || propertyHolder.type == TransactionTreeNodeType.HIER)
|
||||
return propertyHolder.getAttributeListForHier();
|
||||
else if(propertyHolder.type == TransactionTreeNodeType.IN_REL){
|
||||
Vector<Object[] > res = new Vector<>();
|
||||
for(ITxRelation rel:propertyHolder.element.getIncomingRelations()){
|
||||
res.add(new Object[]{
|
||||
case TX:
|
||||
case ATTRS:
|
||||
case HIER:
|
||||
return node.getAttributeListForHier();
|
||||
case IN_REL:
|
||||
Vector<Object[] > res_in = new Vector<>();
|
||||
for(ITxRelation rel:node.element.getIncomingRelations()){
|
||||
res_in.add(new Object[]{
|
||||
rel.getRelationType(),
|
||||
rel.getSource().getGenerator().getName(),
|
||||
rel.getSource()});
|
||||
}
|
||||
return res.toArray();
|
||||
} else if(propertyHolder.type == TransactionTreeNodeType.OUT_REL){
|
||||
Vector<Object[] > res = new Vector<>();
|
||||
for(ITxRelation rel:propertyHolder.element.getOutgoingRelations()){
|
||||
res.add(new Object[]{
|
||||
return res_in.toArray();
|
||||
case OUT_REL:
|
||||
Vector<Object[] > res_out = new Vector<>();
|
||||
for(ITxRelation rel:node.element.getOutgoingRelations()){
|
||||
res_out.add(new Object[]{
|
||||
rel.getRelationType(),
|
||||
rel.getTarget().getGenerator().getName(),
|
||||
rel.getTarget()});
|
||||
}
|
||||
return res.toArray();
|
||||
return res_out.toArray();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -72,6 +72,13 @@ public class AttributeLabelProvider extends LabelProvider implements IStyledLabe
|
||||
return new StyledString(iTx.getId().toString());
|
||||
case TX_TIME:
|
||||
return new StyledString(waveformViewerPart.getScaledTime(iTx.getBeginTime()));
|
||||
case TYPE:
|
||||
if(showProp!=null){
|
||||
List<ITxAttribute> res = iTx.getAttributes().stream().filter(a -> showProp.equals(a.getName())).collect(Collectors.toList());
|
||||
if(res.size()==1)
|
||||
return new StyledString(res.get(0).getDataType().toString());
|
||||
}
|
||||
return new StyledString("");
|
||||
case VALUE:
|
||||
if(showProp!=null){
|
||||
List<ITxAttribute> res = iTx.getAttributes().stream().filter(a -> showProp.equals(a.getName())).collect(Collectors.toList());
|
||||
@ -95,21 +102,40 @@ public class AttributeLabelProvider extends LabelProvider implements IStyledLabe
|
||||
} else
|
||||
return new StyledString(element.toString());
|
||||
case TYPE:
|
||||
if (element instanceof ITxAttribute) {
|
||||
if(element instanceof TransactionTreeNode) {
|
||||
if(showProp!=null){
|
||||
ITx iTx = ((TransactionTreeNode) element).element;
|
||||
List<ITxAttribute> res = iTx.getAttributes().stream().filter(a -> showProp.equals(a.getName())).collect(Collectors.toList());
|
||||
if(res.size()==1)
|
||||
return new StyledString(res.get(0).getDataType().toString());
|
||||
}
|
||||
return new StyledString("");
|
||||
} else if (element instanceof ITxAttribute) {
|
||||
ITxAttribute attribute = (ITxAttribute) element;
|
||||
return new StyledString(attribute.getDataType().toString());
|
||||
}else if(element instanceof Object[]){
|
||||
} else if(element instanceof Object[]){
|
||||
Object[] elements = (Object[]) element;
|
||||
return new StyledString(elements[field].toString());
|
||||
}else
|
||||
} else
|
||||
return new StyledString(""); //$NON-NLS-1$
|
||||
case TX_TIME:
|
||||
return new StyledString(""); //$NON-NLS-1$
|
||||
default:
|
||||
if (element instanceof ITxAttribute) {
|
||||
if(element instanceof TransactionTreeNode) {
|
||||
ITx iTx = ((TransactionTreeNode) element).element;
|
||||
return new StyledString(waveformViewerPart.getScaledTime(iTx.getBeginTime()));
|
||||
}
|
||||
case VALUE:
|
||||
if(element instanceof TransactionTreeNode) {
|
||||
if(showProp!=null){
|
||||
ITx iTx = ((TransactionTreeNode) element).element;
|
||||
List<ITxAttribute> res = iTx.getAttributes().stream().filter(a -> showProp.equals(a.getName())).collect(Collectors.toList());
|
||||
if(res.size()==1)
|
||||
return getAttrValueAsStyledString(res.get(0));
|
||||
}
|
||||
return new StyledString("");
|
||||
} else if (element instanceof ITxAttribute) {
|
||||
ITxAttribute attribute = (ITxAttribute) element;
|
||||
return getAttrValueAsStyledString(attribute);
|
||||
}else if(element instanceof Object[]){
|
||||
} else if(element instanceof Object[]){
|
||||
Object[] elements = (Object[]) element;
|
||||
Object o = elements[field];
|
||||
if(o instanceof ITx) {
|
||||
|
@ -43,6 +43,7 @@ public class TransactionTreeNode implements Comparable<TransactionTreeNode>{
|
||||
*/
|
||||
public String toString(){
|
||||
switch(type){
|
||||
case TX: return "tx#"+element.getId();
|
||||
case PROPS: return Messages.TransactionDetails_10;
|
||||
case ATTRS: return Messages.TransactionDetails_11;
|
||||
case IN_REL: return Messages.TransactionDetails_12;
|
||||
|
@ -4,6 +4,7 @@ package com.minres.scviewer.e4.application.parts.txTableTree;
|
||||
* The Enum Type.
|
||||
*/
|
||||
public enum TransactionTreeNodeType {
|
||||
TX, /** The transaction. */
|
||||
PROPS, /** The props. */
|
||||
ATTRS, /** The attrs. */
|
||||
IN_REL, /** The in rel. */
|
||||
|
@ -40,7 +40,7 @@ public class TxFilter extends ViewerFilter {
|
||||
* @param s the new search text
|
||||
*/
|
||||
public void setSearchValue(String s) {
|
||||
this.searchValue = s; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
this.searchValue = s;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -50,11 +50,15 @@ public class TxFilter extends ViewerFilter {
|
||||
public boolean select(Viewer viewer, Object parentElement, Object element) {
|
||||
if (searchValue == null || searchValue.length() == 0)
|
||||
return true;
|
||||
if(element instanceof ITx) {
|
||||
ITx iTx = (ITx) element;
|
||||
List<ITxAttribute> res = iTx.getAttributes().stream().filter(a -> searchProp.equals(a.getName())).collect(Collectors.toList());
|
||||
if(res.size()==1) {
|
||||
try {
|
||||
ITx iTx = null;
|
||||
if(element instanceof ITx)
|
||||
iTx = (ITx) element;
|
||||
else if(element instanceof TransactionTreeNode && ((TransactionTreeNode)element).type == TransactionTreeNodeType.TX)
|
||||
iTx = ((TransactionTreeNode)element).element;
|
||||
if(iTx==null) return true;
|
||||
List<ITxAttribute> res = iTx.getAttributes().stream().filter(a -> searchProp.equals(a.getName())).collect(Collectors.toList());
|
||||
if(res.size()==1) {
|
||||
try {
|
||||
ITxAttribute attr =res.get(0);
|
||||
switch(searchType) {
|
||||
case BOOLEAN: // bool
|
||||
@ -74,11 +78,9 @@ public class TxFilter extends ViewerFilter {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} catch(RuntimeException ex) {
|
||||
return false;
|
||||
}
|
||||
} catch(RuntimeException ex) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||
<version>2.9.0-SNAPSHOT</version>
|
||||
<version>2.9.2-SNAPSHOT</version>
|
||||
<packaging>eclipse-repository</packaging>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<build>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?pde version="3.5"?>
|
||||
|
||||
<product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.9.0.qualifier" useFeatures="true" includeLaunchers="true">
|
||||
<product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.9.2.qualifier" useFeatures="true" includeLaunchers="true">
|
||||
|
||||
<configIni use="default">
|
||||
</configIni>
|
||||
@ -49,6 +49,7 @@
|
||||
<features>
|
||||
<feature id="com.minres.scviewer.e4.feature" installMode="root"/>
|
||||
<feature id="com.minres.scviewer.e4.platform.feature" installMode="root"/>
|
||||
<feature id="org.eclipse.equinox.p2.core.feature" installMode="root"/>
|
||||
</features>
|
||||
|
||||
<configurations>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>com.minres.scviewer.e4.product_slim</artifactId>
|
||||
<version>2.9.0-SNAPSHOT</version>
|
||||
<version>2.9.2-SNAPSHOT</version>
|
||||
<packaging>eclipse-repository</packaging>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<build>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?pde version="3.5"?>
|
||||
|
||||
<product name="SCViewer" uid="product_slim" id="com.minres.scviewer.e4.application.product_slim" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.9.0.qualifier" useFeatures="false" includeLaunchers="true">
|
||||
<product name="SCViewer" uid="product_slim" id="com.minres.scviewer.e4.application.product_slim" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.9.2.qualifier" useFeatures="false" includeLaunchers="true">
|
||||
|
||||
<configIni use="default">
|
||||
</configIni>
|
||||
|
Reference in New Issue
Block a user