Merge branch 'release/2.10.0'

This commit is contained in:
Eyck Jentzsch 2020-11-27 09:34:20 +01:00
commit 929af41dd3
13 changed files with 60 additions and 65 deletions

View File

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
Bundle-Version: 2.9.3.qualifier Bundle-Version: 2.10.0.qualifier
Bundle-Vendor: %Bundle-Vendor Bundle-Vendor: %Bundle-Vendor
Require-Bundle: javax.inject;bundle-version="1.0.0", Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="3.11.1", org.eclipse.core.runtime;bundle-version="3.11.1",

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"> <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> <modelVersion>4.0.0</modelVersion>
<artifactId>com.minres.scviewer.e4.application</artifactId> <artifactId>com.minres.scviewer.e4.application</artifactId>
<version>2.9.3-SNAPSHOT</version> <version>2.10.0-SNAPSHOT</version>
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>

View File

@ -41,8 +41,6 @@ public class SearchHandler {
public void execute(Shell shell, MPart activePart){ public void execute(Shell shell, MPart activePart){
Object obj = activePart.getObject(); Object obj = activePart.getObject();
if(obj instanceof WaveformViewer){ if(obj instanceof WaveformViewer){
WaveformViewer wfv = (WaveformViewer)obj;
wfv.showSearch();
// ISelection sel = wfv.getSelection(); // ISelection sel = wfv.getSelection();
// if(sel instanceof StructuredSelection) { // if(sel instanceof StructuredSelection) {
// TrackEntry e = findTrackEntry(((StructuredSelection)sel).toArray()); // TrackEntry e = findTrackEntry(((StructuredSelection)sel).toArray());

View File

@ -22,7 +22,7 @@ StatusBarControl_2=\nLast task:
StatusBarControl_3=Currently running: StatusBarControl_3=Currently running:
StatusBarControl_4=No background progress running. StatusBarControl_4=No background progress running.
SWTResourceManager_0=Wrong decorate corner SWTResourceManager_0=Wrong decorate corner
TransactionDetails_0=Enter text to filter TransactionDetails_0=Enter text to filter attributes
TransactionDetails_1=Name TransactionDetails_1=Name
TransactionDetails_10=Properties TransactionDetails_10=Properties
TransactionDetails_11=Attributes TransactionDetails_11=Attributes

View File

@ -48,6 +48,7 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
@ -114,6 +115,7 @@ public class TransactionDetails {
*/ */
@PostConstruct @PostConstruct
public void createComposite(final Composite parent, @Optional WaveformViewer waveformViewerPart) { public void createComposite(final Composite parent, @Optional WaveformViewer waveformViewerPart) {
parent.setLayout(new FillLayout());
this.waveformViewerPart=waveformViewerPart; this.waveformViewerPart=waveformViewerPart;
top = new Composite(parent, SWT.NONE); top = new Composite(parent, SWT.NONE);
@ -378,6 +380,7 @@ public class TransactionDetails {
} }
private void setTopItemFromHier(List<String> names, TreeItem [] items) { private void setTopItemFromHier(List<String> names, TreeItem [] items) {
if(names.size()==0) return;
for (TreeItem item : items) { // find item from category for (TreeItem item : items) { // find item from category
if(item.getText(0).equals(names.get(0))) { if(item.getText(0).equals(names.get(0))) {
if(names.size()==1 || item.getItemCount()==0) { if(names.size()==1 || item.getItemCount()==0) {

View File

@ -13,8 +13,10 @@ import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.jface.viewers.TableViewerColumn;
@ -23,6 +25,7 @@ import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Combo;
@ -98,6 +101,8 @@ public class TransactionList extends Composite {
*/ */
public TransactionList(Composite parent, int style, WaveformViewer waveformViewer) { public TransactionList(Composite parent, int style, WaveformViewer waveformViewer) {
super(parent, style); super(parent, style);
parent.setLayout(new FillLayout());
setLayout(new GridLayout(5, false)); setLayout(new GridLayout(5, false));
txFilter = new TxFilter(); txFilter = new TxFilter();
@ -186,10 +191,10 @@ public class TransactionList extends Composite {
} }
}); });
tableViewer.addFilter(txFilter); tableViewer.addFilter(txFilter);
tableViewer.addDoubleClickListener(new IDoubleClickListener() { tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override @Override
public void doubleClick(DoubleClickEvent event) { public void selectionChanged(SelectionChangedEvent event) {
ISelection treeSelection = tableViewer.getSelection(); ISelection treeSelection = event.getSelection();
if(treeSelection instanceof IStructuredSelection) { if(treeSelection instanceof IStructuredSelection) {
Object selected = ((IStructuredSelection)treeSelection).getFirstElement(); Object selected = ((IStructuredSelection)treeSelection).getFirstElement();
if(selected instanceof ITx){ if(selected instanceof ITx){
@ -230,11 +235,6 @@ public class TransactionList extends Composite {
// Turn on the header and the lines // Turn on the header and the lines
table.setHeaderVisible(true); table.setHeaderVisible(true);
table.setLinesVisible(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) { public void setInput(TrackEntry trackEntry) {

View File

@ -181,9 +181,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
/** The waveform pane. */ /** The waveform pane. */
private IWaveformView waveformPane; private IWaveformView waveformPane;
private CTabFolder tabFolder;
private CTabItem tbtmSearchResults;
/** get UISynchronize injected as field */ /** get UISynchronize injected as field */
@Inject UISynchronize sync; @Inject UISynchronize sync;
@ -278,43 +275,31 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
} }
}); });
parent.setLayout(new FillLayout(SWT.HORIZONTAL)); parent.setLayout(new FillLayout(SWT.HORIZONTAL));
SashForm sashFormTop = new SashForm(parent, SWT.BORDER | SWT.SMOOTH);
Composite left = new Composite(sashFormTop, SWT.NONE);
IEclipseContext ctx = myPart.getContext(); IEclipseContext ctx = myPart.getContext();
ctx.set(WaveformViewer.class, this); ctx.set(WaveformViewer.class, this);
ctx.set(IWaveformDb.class, database); ctx.set(IWaveformDb.class, database);
ctx.set(Composite.class, left);
SashForm topSash = new SashForm(parent, SWT.BORDER | SWT.SMOOTH | SWT.HORIZONTAL);
Composite left = new Composite(topSash, SWT.NONE);
SashForm middleSash = new SashForm(topSash, SWT.BORDER | SWT.SMOOTH | SWT.VERTICAL);
Composite right = new Composite(topSash, SWT.NONE);
topSash.setWeights(new int[] {20, 60, 20});
Composite middleTop = new Composite(middleSash, SWT.NONE);
Composite middleBottom = new Composite(middleSash, SWT.NONE);
middleSash.setWeights(new int[] {75, 25});
ctx.set(Composite.class, left);
browser = ContextInjectionFactory.make(DesignBrowser.class, ctx); browser = ContextInjectionFactory.make(DesignBrowser.class, ctx);
//Composite right = new Composite(sashFormTop, SWT.NONE); ctx.set(Composite.class, right);
SashForm sashFormRight = new SashForm(sashFormTop, SWT.BORDER | SWT.SMOOTH | SWT.VERTICAL);
sashFormTop.setWeights(new int[] {25, 75});
Composite rightTop = new Composite(sashFormRight, SWT.NONE);
waveformPane = factory.createPanel(rightTop);
tabFolder = new CTabFolder(sashFormRight, SWT.BORDER);
tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
CTabItem tbtmDetails = new CTabItem(tabFolder, SWT.NONE);
tbtmDetails.setText("Transaction Details");
ctx.set(Composite.class, tabFolder);
detailsView = ContextInjectionFactory.make(TransactionDetails.class, ctx); detailsView = ContextInjectionFactory.make(TransactionDetails.class, ctx);
tbtmDetails.setControl(detailsView.getControl());
tbtmSearchResults = new CTabItem(tabFolder, SWT.NONE); waveformPane = factory.createPanel(middleTop);
tbtmSearchResults.setText("Search Results");
ctx.set(Composite.class, middleBottom);
transactionList = ContextInjectionFactory.make(TransactionListView.class, ctx); transactionList = ContextInjectionFactory.make(TransactionListView.class, ctx);
tbtmSearchResults.setControl(transactionList.getControl());
sashFormRight.setWeights(new int[] {75, 25});
tabFolder.setSelection(0);
waveformPane.setMaxTime(0); waveformPane.setMaxTime(0);
setupColors(); setupColors();
@ -1315,15 +1300,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
} }
} }
public void showSearch() {
tabFolder.setSelection(tbtmSearchResults);
}
public void search(String propName, DataType type, String propValue) { public void search(String propName, DataType type, String propValue) {
// StructuredSelection sel = (StructuredSelection) getSelection(); // StructuredSelection sel = (StructuredSelection) getSelection();
// TrackEntry e = findTrackEntry((sel).toArray()); // TrackEntry e = findTrackEntry((sel).toArray());
// if(e==null) return; // if(e==null) return;
tabFolder.setSelection(tbtmSearchResults);
transactionList.getControl().setSearchProps(propName, type, propValue); transactionList.getControl().setSearchProps(propName, type, propValue);
} }
} }

View File

@ -43,13 +43,14 @@ public class TxAttributeFilter extends ViewerFilter {
return true; return true;
} }
} }
if(element instanceof Object[]) { // if(element instanceof Object[]) {
try { // try {
return (((Object[])element)[0]).toString().toLowerCase().matches(searchString.toLowerCase()); // return (((Object[])element)[0]).toString().toLowerCase().matches(searchString.toLowerCase());
} catch (PatternSyntaxException e) { // } catch (PatternSyntaxException e) {
// return true;
// }
// }
// return false;
return true; return true;
} }
} }
return false;
}
}

View File

@ -2,6 +2,8 @@ package com.minres.scviewer.e4.application.parts.txTableTree;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.List; import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException; import java.util.regex.PatternSyntaxException;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -24,6 +26,8 @@ public class TxFilter extends ViewerFilter {
/** The search string. */ /** The search string. */
private String searchValue; private String searchValue;
private Pattern pattern=null;
/** /**
* Sets the search text. * Sets the search text.
* *
@ -41,6 +45,14 @@ public class TxFilter extends ViewerFilter {
*/ */
public void setSearchValue(String s) { public void setSearchValue(String s) {
this.searchValue = s; this.searchValue = s;
if(searchType==DataType.STRING) {
try {
//pattern = Pattern.compile(searchValue, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
pattern = Pattern.compile(searchValue);
} catch (PatternSyntaxException e) {
pattern = null;
}
}
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -70,9 +82,10 @@ public class TxFilter extends ViewerFilter {
BigInteger sval = parseBigInteger(searchValue); BigInteger sval = parseBigInteger(searchValue);
return lval.equals(sval); return lval.equals(sval);
case STRING: case STRING:
try { if(pattern!=null) {
return (((ITxAttribute) element).getName().toLowerCase().matches(searchValue.toLowerCase())); Matcher matcher = pattern.matcher( attr.getValue().toString());
} catch (PatternSyntaxException e) { return matcher.find();
} else {
return true; return true;
} }
default: default:

View File

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

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?> <?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.3.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.10.0.qualifier" useFeatures="true" includeLaunchers="true">
<configIni use="default"> <configIni use="default">
</configIni> </configIni>

View File

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

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?> <?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.3.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.10.0.qualifier" useFeatures="false" includeLaunchers="true">
<configIni use="default"> <configIni use="default">
</configIni> </configIni>