From 31af3b4c949a96f19a2115f63d097dd6865b035a Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 24 Oct 2015 23:15:07 +0200 Subject: [PATCH] - fixed tests - added missing functions - added launch configs --- .../eclipse/wb/swt/SWTResourceManager.java | 4 +- .../DatabaseServicesTest.launch | 46 ++++++ .../META-INF/MANIFEST.MF | 1 + .../OSGI-INF/component.xml | 5 + .../build.properties | 13 +- .../database/test/DatabaseServicesTest.java | 59 ++++--- .../Application.e4xmi | 12 +- .../META-INF/MANIFEST.MF | 3 +- .../icons/append_all_waves.png | Bin 0 -> 3150 bytes .../icons/append_wave.png | Bin 0 -> 3101 bytes .../icons/insert_all_waves.png | Bin 0 -> 3143 bytes .../icons/insert_wave.png | Bin 0 -> 3066 bytes .../e4/application/internal/HeapStatus.java | 19 ++- .../internal/StatusBarControl.java | 124 +++++++------- .../internal/WaveStatusBarControl.java | 4 +- .../application/parts/WaveformListPart.java | 152 +++++++++++++----- .../application/parts/WaveformViewerPart.java | 8 +- .../org/eclipse/wb/swt/ResourceManager.java | 4 +- .../SCViewer (restart).launch | 34 ++++ .../SCViewer.launch | 34 ++++ com.minres.scviewer.target/mars.target | 10 +- 21 files changed, 366 insertions(+), 166 deletions(-) create mode 100644 com.minres.scviewer.database.test/DatabaseServicesTest.launch create mode 100644 com.minres.scviewer.database.test/OSGI-INF/component.xml create mode 100644 com.minres.scviewer.e4.application/icons/append_all_waves.png create mode 100644 com.minres.scviewer.e4.application/icons/append_wave.png create mode 100644 com.minres.scviewer.e4.application/icons/insert_all_waves.png create mode 100644 com.minres.scviewer.e4.application/icons/insert_wave.png create mode 100644 com.minres.scviewer.e4.product/SCViewer (restart).launch create mode 100644 com.minres.scviewer.e4.product/SCViewer.launch diff --git a/com.minres.scviewer.database.swt/src/org/eclipse/wb/swt/SWTResourceManager.java b/com.minres.scviewer.database.swt/src/org/eclipse/wb/swt/SWTResourceManager.java index 20a9264..8b6d4cc 100644 --- a/com.minres.scviewer.database.swt/src/org/eclipse/wb/swt/SWTResourceManager.java +++ b/com.minres.scviewer.database.swt/src/org/eclipse/wb/swt/SWTResourceManager.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2015 MINRES Technologies GmbH and others. + * Copyright (c) 2011 Google, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * MINRES Technologies GmbH - initial API and implementation + * Google, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.wb.swt; diff --git a/com.minres.scviewer.database.test/DatabaseServicesTest.launch b/com.minres.scviewer.database.test/DatabaseServicesTest.launch new file mode 100644 index 0000000..8a79ccd --- /dev/null +++ b/com.minres.scviewer.database.test/DatabaseServicesTest.launch @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.minres.scviewer.database.test/META-INF/MANIFEST.MF b/com.minres.scviewer.database.test/META-INF/MANIFEST.MF index 2995fbb..30928c6 100644 --- a/com.minres.scviewer.database.test/META-INF/MANIFEST.MF +++ b/com.minres.scviewer.database.test/META-INF/MANIFEST.MF @@ -11,3 +11,4 @@ Require-Bundle: org.junit, com.minres.scviewer.database.text;bundle-version="1.0.0", com.minres.scviewer.database.vcd;bundle-version="1.0.0" Bundle-ActivationPolicy: lazy +Service-Component: OSGI-INF/component.xml diff --git a/com.minres.scviewer.database.test/OSGI-INF/component.xml b/com.minres.scviewer.database.test/OSGI-INF/component.xml new file mode 100644 index 0000000..7ebc679 --- /dev/null +++ b/com.minres.scviewer.database.test/OSGI-INF/component.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/com.minres.scviewer.database.test/build.properties b/com.minres.scviewer.database.test/build.properties index 9066d9d..e310bbc 100644 --- a/com.minres.scviewer.database.test/build.properties +++ b/com.minres.scviewer.database.test/build.properties @@ -1,13 +1,4 @@ -############################################################################### -# Copyright (c) 2014, 2015 MINRES Technologies GmbH and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# MINRES Technologies GmbH - initial API and implementation -############################################################################### bin.includes = META-INF/,\ - . + .,\ + OSGI-INF/component.xml source.. = src/ diff --git a/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java b/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java index e15c231..30b2219 100644 --- a/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java +++ b/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java @@ -21,20 +21,36 @@ import org.junit.Before; import org.junit.Test; import com.minres.scviewer.database.IWaveformDb; -import com.minres.scviewer.database.internal.WaveformDb; +import com.minres.scviewer.database.IWaveformDbFactory; public class DatabaseServicesTest { + + private static IWaveformDbFactory waveformDbFactory; + + private IWaveformDb waveformDb; + + public synchronized void setFactory(IWaveformDbFactory service) { + waveformDbFactory = service; + } + + public synchronized void unsetFactory(IWaveformDbFactory service) { + if (waveformDbFactory == service) { + waveformDbFactory = null; + } + } + @Before public void setUp() throws Exception { + waveformDb=waveformDbFactory.getDatabase(); // Wait for OSGi dependencies - for (int i = 0; i < 10; i++) { - if (WaveformDb.getLoaders().size() == 3) // Dependencies fulfilled - return; - Thread.sleep(1000); - } - assertEquals("OSGi dependencies unfulfilled", 3, WaveformDb.getLoaders().size()); - } +// for (int i = 0; i < 10; i++) { +// if (waveformDb.size() == 3) // Dependencies fulfilled +// return; +// Thread.sleep(1000); +// } +// assertEquals("OSGi dependencies unfulfilled", 3, WaveformDb.getLoaders().size()); + } @After public void tearDown() throws Exception { @@ -44,33 +60,30 @@ public class DatabaseServicesTest { public void testVCD() throws Exception { File f = new File("inputs/my_db.vcd").getAbsoluteFile(); assertTrue(f.exists()); - IWaveformDb database=new WaveformDb(); - database.load(f); - assertNotNull(database); - assertEquals(14, database.getAllWaves().size()); - assertEquals(2, database.getChildNodes().size()); + waveformDb.load(f); + assertNotNull(waveformDb); + assertEquals(14, waveformDb.getAllWaves().size()); + assertEquals(2, waveformDb.getChildNodes().size()); } @Test public void testTxSQLite() throws Exception { File f = new File("inputs/my_db.txdb").getAbsoluteFile(); assertTrue(f.exists()); - IWaveformDb database=new WaveformDb(); - database.load(f); - assertNotNull(database); - assertEquals(3, database.getAllWaves().size()); - assertEquals(1, database.getChildNodes().size()); + waveformDb.load(f); + assertNotNull(waveformDb); + assertEquals(3, waveformDb.getAllWaves().size()); + assertEquals(1, waveformDb.getChildNodes().size()); } @Test public void testTxText() throws Exception { File f = new File("inputs/my_db.txlog").getAbsoluteFile(); assertTrue(f.exists()); - IWaveformDb database=new WaveformDb(); - database.load(f); - assertNotNull(database); - assertEquals(3, database.getAllWaves().size()); - assertEquals(1, database.getChildNodes().size()); + waveformDb.load(f); + assertNotNull(waveformDb); + assertEquals(3, waveformDb.getAllWaves().size()); + assertEquals(1, waveformDb.getChildNodes().size()); } diff --git a/com.minres.scviewer.e4.application/Application.e4xmi b/com.minres.scviewer.e4.application/Application.e4xmi index 3dd80be..b06a5d1 100644 --- a/com.minres.scviewer.e4.application/Application.e4xmi +++ b/com.minres.scviewer.e4.application/Application.e4xmi @@ -98,15 +98,13 @@ - - - - glue - move_after:PerspectiveSpacer - SHOW_RESTORE_MENU + + stretch - + + Draggable + diff --git a/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF b/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF index fe3be3e..43bab36 100644 --- a/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF +++ b/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF @@ -23,7 +23,8 @@ Require-Bundle: javax.inject;bundle-version="1.0.0", org.eclipse.osgi.services;bundle-version="3.5.0", org.eclipse.core.jobs, org.eclipse.osgi, - com.google.guava + com.google.guava, + org.eclipse.equinox.preferences Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: com.minres.scviewer.database, javax.inject;version="1.0.0" diff --git a/com.minres.scviewer.e4.application/icons/append_all_waves.png b/com.minres.scviewer.e4.application/icons/append_all_waves.png new file mode 100644 index 0000000000000000000000000000000000000000..8a4698d76d92558658ca978e7d0fd3d3a54b805d GIT binary patch literal 3150 zcmV-U46*ZxP)EX>4Tx07%E3mUmQC*A|D*y?1({%`nm#dXp|Nfb=dP9RyJrW(F9_0K*JTY>22p zL=h1IMUbF?0i&TvtcYSED5zi$NDxqBFp8+CWJcCXe0h2A<>mLsz2Dkr?{oLrd!Mx~ z03=TzE-wX^0w9?u;0Jm*(^rK@(6Rjh26%u0rT{Qm>8ZX!?!iDLFE@L0LWj&=4?(nOT_siPRbOditRHZrp6?S8AgejFG^6va$=5K z|`EW#NwP&*~x4%_lS6VhL9s-#7D#h8C*`Lh;NHnGf9}t74chfY%+(L z4giWIwhK6{coCb3n8XhbbP@4#0C1$ZFF5847I3lz;zPNlq-OKEaq$AWE=!MYYHiJ+ zdvY?9I0Av8Ka-Wn(gPeepdb@piwLhwjRWWeSr7baCBSDM=|pK0Q5^$>Pur z|2)M1IPkCYSQ^NQ`z*pYmq4Rp8z$= z2uR(a0_5jDfT9oq5_wSE_22vEgAWDbn-``!u{igi1^xT3aEbVl&W-yV=Mor9X9@Wk zi)-R*3DAH5Bmou30~MeFbb%o-16IHmI084Y0{DSo5DwM?7KjJQfDbZ3F4znTKoQsl z_JT@K1L{E|XaOfc2RIEbfXm=IxC!on2Vew@gXdrdyaDqN1YsdEM1kZXRY(gmfXpBU zWDmJPK2RVO4n;$85DyYUxzHA<2r7jtp<1XB`W89`U4X7a1JFHa6qn9`(3jA6(BtSg7z~Dn(ZN_@JTc*z z1k5^2G3EfK6>}alfEmNgVzF3xtO3>z>xX4x1=s@Ye(W*qIqV>I9QzhW#Hr%UaPGJW z91oX=E5|kA&f*4f6S#T26kZE&gZIO;@!9wid_BGke*-^`pC?EYbO?5YU_t_6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G*K3n~4{CVp0`RRh6rGKt|q5I;yUmSnwn^`q8{*wQ4;n(6< z@~@7(UiP|s)_?Z#o8&k1bA@l^-yVI(c-Q+r?ES=i<_GMDijR69yFPh;dbp6hu<#rA zg!B8%JG^WF000JJOGiWi{{a60|De66lK=n!32;bRa{vGf6951U69E94oEQKA00(qQ zO+^Ra3KtItH&kK=C;$Kfph-kQR5;6}lQC;kQ5462*W}&AM0l~Lnx%u{;-W)9Fqo+z zhG!>*Os|kd6hDAV-CXr8y3E=zwnlT0uIZ=&9!}~8lMDB_RTIvl*@Ra2NN6L9Xk1K@b3-thKycZQF&pf*Me()oOR#I3hx`*&G!73viTH&mT<1 zt@*ys1YZC+H%K@%M?78n!R(7o`o0iF(O8Xoz!f(^+R3n+7j8fM#QO3ws;0hE1Hv6)`a**IMa|w+ib|yd1+Jdz9{?0`kk2MKuN`*x9ll?Cm7@0{J(@5R%wUY6 z)oLC0U}3I6w@1CP)#KZjU#!2r83Ey_wr97)_WgFKYAQSi@H~%0bHt^bvy!`+$>g&;8%Yta6Sh2MpgTj~PUg!2kdN07*qoM6N<$g2NXC3;+NC literal 0 HcmV?d00001 diff --git a/com.minres.scviewer.e4.application/icons/append_wave.png b/com.minres.scviewer.e4.application/icons/append_wave.png new file mode 100644 index 0000000000000000000000000000000000000000..cea9636a916ab63bc6b06e159d86588b198b4091 GIT binary patch literal 3101 zcmV+&4C3>NP)EX>4Tx07%E3mUmQC*A|D*y?1({%`nm#dXp|Nfb=dP9RyJrW(F9_0K*JTY>22p zL=h1IMUbF?0i&TvtcYSED5zi$NDxqBFp8+CWJcCXe0h2A<>mLsz2Dkr?{oLrd!Mx~ z03=TzE-wX^0w9?u;0Jm*(^rK@(6Rjh26%u0rT{Qm>8ZX!?!iDLFE@L0LWj&=4?(nOT_siPRbOditRHZrp6?S8AgejFG^6va$=5K z|`EW#NwP&*~x4%_lS6VhL9s-#7D#h8C*`Lh;NHnGf9}t74chfY%+(L z4giWIwhK6{coCb3n8XhbbP@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Hj{Lt2K+24M{>PF{H>ziEz%LmR5It*U8<$CM#ZLizc@2tEtFcdO$cQ|r*xkvZnNio#z9&IX9*nWZp8u5o(}(f= zr{t&Q6RH!9lV+2rr`)G*K3n~4{CVp0`RRh6rGKt|q5I;yUmSnwn^`q8{*wQ4;n(6< z@~@7(UiP|s)_?Z#o8&k1bA@l^-yVI(c-Q+r?ES=i<_GMDijR69yFPh;dbp6hu<#rA zg!B8%JG^WF000JJOGiWi{{a60|De66lK=n!32;bRa{vGf6951U69E94oEQKA00(qQ zO+^Ra3KtIqH0DMHQ2+n|Oi4sRR5;76Q@=|>VH7=IzW1^pP>G?7L(vjM4MI~+P4XOy zXb~Rd&=9pZH8uGsh=Wj*Lm-mS^8SIaC5&ij2#QxBDh<_lKjJo+4~?EiuM20q=bm%! zy@HwHr-tCOGyt$HtD=+w5&ej2wQBYyAfgqoW+Fm5odyx1dx&k@Z3bq>VcB73#$TXy zq-0MU*iVIAX_jSSfUVvT-_-|pj_$E~aDy*fkWzZ0Cj$V8Oau_rM@#iEtu60f;=EXd z$cSsN@I*#{3q0=<)E)@a;{k-HjB+D1yqQcUC8C)5)fxfhqLbk8SO6o2j(Sti-_2&X z@p=~g-Vn26P)fmZoVJqgOWZqtEIl{hwA-tfjf>op6d6(LH=PT-;94+E6Or{io=&z> z1`* 0){ // --- some tasks are still running --- + progressBar.setToolTipText("Currently running: " + runningTasks); + } else { // --- all tasks are done (a reset of selection could also be done) --- + progressBar.setToolTipText("No background progress running."); + } + } + }); + // clean-up + event.getJob().removeJobChangeListener(this); + } + }); + } + return this; } } } \ No newline at end of file diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/WaveStatusBarControl.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/WaveStatusBarControl.java index 6611a5a..344b5df 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/WaveStatusBarControl.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/WaveStatusBarControl.java @@ -82,8 +82,8 @@ public class WaveStatusBarControl extends StatusBarControl { super(sync); zoomContribution = new TextContributionItem("Z:", 150); cursorContribution = new TextContributionItem("C:", 120); - manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution); - manager.appendToGroup(StatusLineManager.MIDDLE_GROUP, zoomContribution); + manager.prependToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution); + manager.appendToGroup(StatusLineManager.BEGIN_GROUP, zoomContribution); } @Inject diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformListPart.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformListPart.java index 172f312..429d713 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformListPart.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformListPart.java @@ -10,6 +10,8 @@ *******************************************************************************/ package com.minres.scviewer.e4.application.parts; +import java.util.Arrays; + import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.inject.Named; @@ -18,10 +20,13 @@ import org.eclipse.e4.core.di.annotations.Optional; import org.eclipse.e4.core.services.events.IEventBroker; import org.eclipse.e4.ui.di.Focus; import org.eclipse.e4.ui.di.UIEventTopic; +import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.e4.ui.services.IServiceConstants; +import org.eclipse.e4.ui.workbench.modeling.EPartService; import org.eclipse.e4.ui.workbench.modeling.ESelectionService; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.TableViewer; @@ -53,9 +58,10 @@ public class WaveformListPart implements ISelectionChangedListener { private Text nameFilter; private TableViewer txTableViewer; - ToolItem appendItem, insertItem; + ToolItem appendItem, insertItem, insertAllItem, appendAllItem; WaveformAttributeFilter attributeFilter; - + int thisSelectionCount=0, otherSelectionCount=0; + @PostConstruct public void createComposite(Composite parent) { parent.setLayout(new GridLayout(1, false)); @@ -66,11 +72,12 @@ public class WaveformListPart implements ISelectionChangedListener { @Override public void modifyText(ModifyEvent e) { attributeFilter.setSearchText(((Text) e.widget).getText()); + updateButtons(); txTableViewer.refresh(); } }); nameFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - + attributeFilter = new WaveformAttributeFilter(); txTableViewer = new TableViewer(parent); @@ -79,14 +86,27 @@ public class WaveformListPart implements ISelectionChangedListener { txTableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH)); txTableViewer.addSelectionChangedListener(this); txTableViewer.addFilter(attributeFilter); - + ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.RIGHT); toolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); toolBar.setBounds(0, 0, 87, 20); + appendItem = new ToolItem(toolBar, SWT.NONE); + appendItem.setToolTipText("Append selected"); + appendItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/append_wave.png")); + appendItem.setEnabled(false); + appendItem.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + eventBroker.post(WaveformViewerPart.ADD_WAVEFORM, + ((IStructuredSelection)txTableViewer.getSelection()).toList()); + + } + }); + insertItem = new ToolItem(toolBar, SWT.NONE); - insertItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/bullet_plus.png")); - insertItem.setText("Insert"); + insertItem.setToolTipText("Insert selected"); + insertItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/insert_wave.png")); insertItem.setEnabled(false); insertItem.addSelectionListener(new SelectionAdapter() { @Override @@ -96,15 +116,33 @@ public class WaveformListPart implements ISelectionChangedListener { } }); - appendItem = new ToolItem(toolBar, SWT.NONE); - appendItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/bullet_plus.png")); - appendItem.setText("Append"); - appendItem.setEnabled(false); - appendItem.addSelectionListener(new SelectionAdapter() { + new ToolItem(toolBar, SWT.SEPARATOR); + + appendAllItem = new ToolItem(toolBar, SWT.NONE); + appendAllItem.setToolTipText("Append all"); + appendAllItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/append_all_waves.png")); + appendAllItem.setEnabled(false); + + new ToolItem(toolBar, SWT.SEPARATOR); + appendAllItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - eventBroker.post(WaveformViewerPart.ADD_WAVEFORM, - ((IStructuredSelection)txTableViewer.getSelection()).toList()); + Object[] all = getFilteredChildren(txTableViewer); + if(all.length>0) + eventBroker.post(WaveformViewerPart.ADD_WAVEFORM, Arrays.asList(all)); + + } + }); + insertAllItem = new ToolItem(toolBar, SWT.NONE); + insertAllItem.setToolTipText("Insert all"); + insertAllItem.setImage(ResourceManager.getPluginImage("com.minres.scviewer.e4.application", "icons/insert_all_waves.png")); + insertAllItem.setEnabled(false); + insertAllItem.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + Object[] all = getFilteredChildren(txTableViewer); + if(all.length>0) + eventBroker.post(WaveformViewerPart.ADD_WAVEFORM, Arrays.asList(all)); } }); @@ -119,6 +157,7 @@ public class WaveformListPart implements ISelectionChangedListener { @Inject @Optional public void getStatusEvent(@UIEventTopic(WaveformViewerPart.ACTIVE_NODE) Object o) { txTableViewer.setInput(o); + updateButtons(); } @Override @@ -131,50 +170,79 @@ public class WaveformListPart implements ISelectionChangedListener { switch(selection.size()){ case 0: appendItem.setEnabled(false); - insertItem.setEnabled(false); break; case 1: selectionService.setSelection(selection.getFirstElement()); - appendItem.setEnabled(true); break; default: selectionService.setSelection(selection.toList()); - appendItem.setEnabled(true); break; } + thisSelectionCount=selection.toList().size(); + updateButtons(); } @Inject - public void setSelection(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional Object object){ - if(txTableViewer!=null && !insertItem.isDisposed() && !appendItem.isDisposed()) - if(object instanceof ITx && appendItem.isEnabled()){ - insertItem.setEnabled(true); - } else if(object instanceof IWaveform && appendItem.isEnabled()){ - insertItem.setEnabled(true); - } else { - insertItem.setEnabled(false); - } + public void setSelection(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional Object object, EPartService partService){ + MPart part = partService.getActivePart(); + if(part!=null && part.getObject() != this) + otherSelectionCount = (object instanceof IWaveform || object instanceof ITx)?1:0; + updateButtons(); } - + + private void updateButtons() { + if(txTableViewer!=null && !insertItem.isDisposed() && !appendItem.isDisposed() && + !appendAllItem.isDisposed() && !insertAllItem.isDisposed()){ + Object[] all = getFilteredChildren(txTableViewer); + appendItem.setEnabled(thisSelectionCount>0); + appendAllItem.setEnabled(all.length>0); + insertItem.setEnabled(thisSelectionCount>0 && otherSelectionCount>0); + insertAllItem.setEnabled(all.length>0 && otherSelectionCount>0); + } + } + public class WaveformAttributeFilter extends ViewerFilter { - private String searchString; + private String searchString; - public void setSearchText(String s) { - this.searchString = ".*" + s + ".*"; - } - - @Override - public boolean select(Viewer viewer, Object parentElement, Object element) { - if (searchString == null || searchString.length() == 0) { - return true; - } - IWaveform p = (IWaveform) element; - if (p.getName().matches(searchString)) { - return true; - } - return false; - } + public void setSearchText(String s) { + this.searchString = ".*" + s + ".*"; } + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) { + if (searchString == null || searchString.length() == 0) { + return true; + } + IWaveform p = (IWaveform) element; + if (p.getName().matches(searchString)) { + return true; + } + return false; + } + } + + protected Object[] getFilteredChildren(TableViewer viewer){ + Object parent = viewer.getInput(); + if(parent==null) return new Object[0]; + Object[] result = null; + if (parent != null) { + IStructuredContentProvider cp = (IStructuredContentProvider) viewer.getContentProvider(); + if (cp != null) { + result = cp.getElements(parent); + if(result==null) return new Object[0]; + for (int i = 0, n = result.length; i < n; ++i) { + if(result[i]==null) return new Object[0]; + } + } + } + ViewerFilter[] filters = viewer.getFilters(); + if (filters != null) { + for (ViewerFilter f:filters) { + Object[] filteredResult = f.filter(viewer, parent, result); + result = filteredResult; + } + } + return result; + } } \ No newline at end of file diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewerPart.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewerPart.java index 2261cb0..9059647 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewerPart.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewerPart.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -155,9 +156,10 @@ public class WaveformViewerPart { protected IStatus run( IProgressMonitor monitor) { // convert to SubMonitor and set total number of work units SubMonitor subMonitor = SubMonitor.convert(monitor, filesToLoad.size()); + subMonitor.setTaskName("Loading database"); try { for(File file: filesToLoad){ -// TimeUnit.SECONDS.sleep(20); + TimeUnit.SECONDS.sleep(2); database.load(file); database.addPropertyChangeListener(txDisplay); subMonitor.worked(1); @@ -169,6 +171,8 @@ public class WaveformViewerPart { e.printStackTrace(); return Status.CANCEL_STATUS; } + subMonitor.done(); + monitor.done(); return Status.OK_STATUS; } }; @@ -271,7 +275,7 @@ public class WaveformViewerPart { @Inject @Optional public void getAddWaveformEvent(@UIEventTopic(WaveformViewerPart.ADD_WAVEFORM) Object o) { - Object sel = selectionService.getSelection(); + Object sel = o==null?selectionService.getSelection():o; if(sel instanceof List) for(Object el:((List)sel)){ if(el instanceof IWaveform) diff --git a/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java b/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java index f42c09f..4bfbc6b 100644 --- a/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java +++ b/com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2015 MINRES Technologies GmbH and others. + * Copyright (c) 2011 Google, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * MINRES Technologies GmbH - initial API and implementation + * Google, Inc. - initial API and implementation *******************************************************************************/ package org.eclipse.wb.swt; diff --git a/com.minres.scviewer.e4.product/SCViewer (restart).launch b/com.minres.scviewer.e4.product/SCViewer (restart).launch new file mode 100644 index 0000000..5faee8e --- /dev/null +++ b/com.minres.scviewer.e4.product/SCViewer (restart).launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.minres.scviewer.e4.product/SCViewer.launch b/com.minres.scviewer.e4.product/SCViewer.launch new file mode 100644 index 0000000..7320b34 --- /dev/null +++ b/com.minres.scviewer.e4.product/SCViewer.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.minres.scviewer.target/mars.target b/com.minres.scviewer.target/mars.target index 68a3830..51b6ba5 100644 --- a/com.minres.scviewer.target/mars.target +++ b/com.minres.scviewer.target/mars.target @@ -1,17 +1,17 @@ - + - - - - + + + + x86_64