Merge branch 'release/2.9.1'

This commit is contained in:
Eyck Jentzsch 2020-11-11 07:25:05 +01:00
commit d47db29b93
17 changed files with 119 additions and 62 deletions

View File

@ -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>

View File

@ -1,2 +1,3 @@
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false

View File

@ -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"/>

View File

@ -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.1.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"

View File

@ -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.1-SNAPSHOT</version>
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>

View File

@ -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");
}
}
}

View File

@ -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[]{

View File

@ -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;
@ -40,6 +39,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 {
@ -115,12 +116,14 @@ public class TransactionList extends Composite {
int idx = searchPropCombo.getSelectionIndex();
AttributeNameBean sel = attrNames.get(idx);
txFilter.setSearchProp(sel.getName(), sel.getType());
treeViewer.refresh();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
int idx = searchPropCombo.getSelectionIndex();
AttributeNameBean sel = attrNames.get(idx);
txFilter.setSearchProp(sel.getName(), sel.getType());
treeViewer.refresh();
}
});
@ -131,7 +134,6 @@ public class TransactionList extends Composite {
public void modifyText(ModifyEvent e) {
txFilter.setSearchValue(((Text) e.widget).getText());
treeViewer.refresh();
//treeViewer.expandAll(false);
}
});
@ -150,25 +152,21 @@ public class TransactionList extends Composite {
@Override
public void widgetSelected(SelectionEvent e) {
int idx = viewPropCombo.getSelectionIndex();
AttributeNameBean sel = attrNames.get(idx);
nameLabelProvider.setShowProp(sel.getName());
nameLabelProvider.setShowProp(attrNames.get(idx).getName());
treeViewer.refresh(true);
}
@Override
public void widgetDefaultSelected(SelectionEvent e) { }
});
treeViewer = new TreeViewer(this, SWT.BORDER);
treeViewer = new TreeViewer(this);
treeViewer.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];
}
@ -181,6 +179,8 @@ public class TransactionList extends Composite {
Object selected = 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));
}
}
});
@ -242,17 +242,18 @@ 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() {
@ -265,6 +266,7 @@ public class TransactionList extends Composite {
searchPropComboViewer.setInput(attrNames);
searchPropComboViewer.setSelection(new StructuredSelection(searchPropComboViewer.getElementAt(0)));
}
treeViewer.refresh(true);
}
});
}

View File

@ -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;

View File

@ -104,9 +104,20 @@ public class AttributeLabelProvider extends LabelProvider implements IStyledLabe
}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[]){

View File

@ -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;

View File

@ -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. */

View File

@ -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,8 +50,12 @@ 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;
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 {
@ -78,8 +82,6 @@ public class TxFilter extends ViewerFilter {
return false;
}
}
return true;
}
return false;
}

View File

@ -10,7 +10,7 @@
<relativePath>../..</relativePath>
</parent>
<artifactId>com.minres.scviewer.e4.product</artifactId>
<version>2.9.0-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<groupId>com.minres.scviewer</groupId>
<build>

View File

@ -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.1.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>

View File

@ -10,7 +10,7 @@
<relativePath>../..</relativePath>
</parent>
<artifactId>com.minres.scviewer.e4.product_slim</artifactId>
<version>2.9.0-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<groupId>com.minres.scviewer</groupId>
<build>

View File

@ -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.1.qualifier" useFeatures="false" includeLaunchers="true">
<configIni use="default">
</configIni>