diff --git a/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF b/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF index e81db03..a82f6b5 100644 --- a/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF +++ b/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF @@ -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.3.qualifier +Bundle-Version: 2.10.0.qualifier Bundle-Vendor: %Bundle-Vendor Require-Bundle: javax.inject;bundle-version="1.0.0", org.eclipse.core.runtime;bundle-version="3.11.1", diff --git a/plugins/com.minres.scviewer.e4.application/pom.xml b/plugins/com.minres.scviewer.e4.application/pom.xml index 61db10f..d4253c4 100644 --- a/plugins/com.minres.scviewer.e4.application/pom.xml +++ b/plugins/com.minres.scviewer.e4.application/pom.xml @@ -1,7 +1,7 @@ 4.0.0 com.minres.scviewer.e4.application - 2.9.3-SNAPSHOT + 2.10.0-SNAPSHOT com.minres.scviewer com.minres.scviewer.parent diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SearchHandler.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SearchHandler.java index 858d2e7..729e6d0 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SearchHandler.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SearchHandler.java @@ -41,8 +41,6 @@ public class SearchHandler { public void execute(Shell shell, MPart activePart){ Object obj = activePart.getObject(); if(obj instanceof WaveformViewer){ - WaveformViewer wfv = (WaveformViewer)obj; - wfv.showSearch(); // ISelection sel = wfv.getSelection(); // if(sel instanceof StructuredSelection) { // TrackEntry e = findTrackEntry(((StructuredSelection)sel).toArray()); diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/messages.properties b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/messages.properties index 8a65853..4cc0144 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/messages.properties +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/messages.properties @@ -22,7 +22,7 @@ StatusBarControl_2=\nLast task: StatusBarControl_3=Currently running: StatusBarControl_4=No background progress running. SWTResourceManager_0=Wrong decorate corner -TransactionDetails_0=Enter text to filter +TransactionDetails_0=Enter text to filter attributes TransactionDetails_1=Name TransactionDetails_10=Properties TransactionDetails_11=Attributes diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java index 1b1069c..b6c2af4 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java @@ -48,6 +48,7 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -114,6 +115,7 @@ public class TransactionDetails { */ @PostConstruct public void createComposite(final Composite parent, @Optional WaveformViewer waveformViewerPart) { + parent.setLayout(new FillLayout()); this.waveformViewerPart=waveformViewerPart; top = new Composite(parent, SWT.NONE); @@ -378,6 +380,7 @@ public class TransactionDetails { } private void setTopItemFromHier(List names, TreeItem [] items) { + if(names.size()==0) return; for (TreeItem item : items) { // find item from category if(item.getText(0).equals(names.get(0))) { if(names.size()==1 || item.getItemCount()==0) { diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java index 0295367..dbad8f9 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java @@ -13,8 +13,10 @@ import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider; import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableViewer; 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.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Combo; @@ -98,6 +101,8 @@ public class TransactionList extends Composite { */ public TransactionList(Composite parent, int style, WaveformViewer waveformViewer) { super(parent, style); + parent.setLayout(new FillLayout()); + setLayout(new GridLayout(5, false)); txFilter = new TxFilter(); @@ -186,10 +191,10 @@ public class TransactionList extends Composite { } }); tableViewer.addFilter(txFilter); - tableViewer.addDoubleClickListener(new IDoubleClickListener() { + tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override - public void doubleClick(DoubleClickEvent event) { - ISelection treeSelection = tableViewer.getSelection(); + public void selectionChanged(SelectionChangedEvent event) { + ISelection treeSelection = event.getSelection(); if(treeSelection instanceof IStructuredSelection) { Object selected = ((IStructuredSelection)treeSelection).getFirstElement(); if(selected instanceof ITx){ @@ -230,11 +235,6 @@ public class TransactionList extends Composite { // Turn on the header and the lines 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) { diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java index 7e340cc..5846845 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java @@ -181,9 +181,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis /** The waveform pane. */ private IWaveformView waveformPane; - private CTabFolder tabFolder; - - private CTabItem tbtmSearchResults; /** get UISynchronize injected as field */ @Inject UISynchronize sync; @@ -278,44 +275,32 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis } }); 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(); ctx.set(WaveformViewer.class, this); 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); - //Composite right = new Composite(sashFormTop, SWT.NONE); - 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); + ctx.set(Composite.class, right); detailsView = ContextInjectionFactory.make(TransactionDetails.class, ctx); - tbtmDetails.setControl(detailsView.getControl()); - - tbtmSearchResults = new CTabItem(tabFolder, SWT.NONE); - tbtmSearchResults.setText("Search Results"); - - transactionList = ContextInjectionFactory.make(TransactionListView.class, ctx); - tbtmSearchResults.setControl(transactionList.getControl()); - - sashFormRight.setWeights(new int[] {75, 25}); - tabFolder.setSelection(0); + waveformPane = factory.createPanel(middleTop); + + ctx.set(Composite.class, middleBottom); + transactionList = ContextInjectionFactory.make(TransactionListView.class, ctx); + waveformPane.setMaxTime(0); setupColors(); //set selection to empty selection when opening a new waveformPane @@ -1314,16 +1299,11 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis eventBroker.post(WaveStatusBarControl.MARKER_DIFF, null); } } - - public void showSearch() { - tabFolder.setSelection(tbtmSearchResults); - } public void search(String propName, DataType type, String propValue) { // StructuredSelection sel = (StructuredSelection) getSelection(); // TrackEntry e = findTrackEntry((sel).toArray()); // if(e==null) return; - tabFolder.setSelection(tbtmSearchResults); transactionList.getControl().setSearchProps(propName, type, propValue); } } \ No newline at end of file diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/TxAttributeFilter.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/TxAttributeFilter.java index f91b0d3..aea24ee 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/TxAttributeFilter.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/TxAttributeFilter.java @@ -43,13 +43,14 @@ public class TxAttributeFilter extends ViewerFilter { return true; } } - if(element instanceof Object[]) { - try { - return (((Object[])element)[0]).toString().toLowerCase().matches(searchString.toLowerCase()); - } catch (PatternSyntaxException e) { - return true; - } - } - return false; +// if(element instanceof Object[]) { +// try { +// return (((Object[])element)[0]).toString().toLowerCase().matches(searchString.toLowerCase()); +// } catch (PatternSyntaxException e) { +// return true; +// } +// } +// return false; + return true; } } \ No newline at end of file diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/TxFilter.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/TxFilter.java index 8dcc644..8b642b5 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/TxFilter.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/TxFilter.java @@ -2,6 +2,8 @@ package com.minres.scviewer.e4.application.parts.txTableTree; import java.math.BigInteger; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import java.util.stream.Collectors; @@ -23,6 +25,8 @@ public class TxFilter extends ViewerFilter { private DataType searchType; /** The search string. */ private String searchValue; + + private Pattern pattern=null; /** * Sets the search text. @@ -41,6 +45,14 @@ public class TxFilter extends ViewerFilter { */ public void setSearchValue(String 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) @@ -70,9 +82,10 @@ public class TxFilter extends ViewerFilter { BigInteger sval = parseBigInteger(searchValue); return lval.equals(sval); case STRING: - try { - return (((ITxAttribute) element).getName().toLowerCase().matches(searchValue.toLowerCase())); - } catch (PatternSyntaxException e) { + if(pattern!=null) { + Matcher matcher = pattern.matcher( attr.getValue().toString()); + return matcher.find(); + } else { return true; } default: diff --git a/products/com.minres.scviewer.e4.product/pom.xml b/products/com.minres.scviewer.e4.product/pom.xml index 81750e9..8ee002e 100644 --- a/products/com.minres.scviewer.e4.product/pom.xml +++ b/products/com.minres.scviewer.e4.product/pom.xml @@ -10,7 +10,7 @@ ../.. com.minres.scviewer.e4.product - 2.9.3-SNAPSHOT + 2.10.0-SNAPSHOT eclipse-repository com.minres.scviewer diff --git a/products/com.minres.scviewer.e4.product/scviewer.product b/products/com.minres.scviewer.e4.product/scviewer.product index 357ba20..104a8a5 100644 --- a/products/com.minres.scviewer.e4.product/scviewer.product +++ b/products/com.minres.scviewer.e4.product/scviewer.product @@ -1,7 +1,7 @@ - + diff --git a/products/com.minres.scviewer.e4.product_slim/pom.xml b/products/com.minres.scviewer.e4.product_slim/pom.xml index 201f112..128791b 100644 --- a/products/com.minres.scviewer.e4.product_slim/pom.xml +++ b/products/com.minres.scviewer.e4.product_slim/pom.xml @@ -10,7 +10,7 @@ ../.. com.minres.scviewer.e4.product_slim - 2.9.3-SNAPSHOT + 2.10.0-SNAPSHOT eclipse-repository com.minres.scviewer diff --git a/products/com.minres.scviewer.e4.product_slim/scviewer.product b/products/com.minres.scviewer.e4.product_slim/scviewer.product index d530758..48c17b8 100644 --- a/products/com.minres.scviewer.e4.product_slim/scviewer.product +++ b/products/com.minres.scviewer.e4.product_slim/scviewer.product @@ -1,7 +1,7 @@ - +