diff --git a/com.minres.scviewer.e4.product/pom.xml b/com.minres.scviewer.e4.product/pom.xml index 59e17ee..fbe589e 100644 --- a/com.minres.scviewer.e4.product/pom.xml +++ b/com.minres.scviewer.e4.product/pom.xml @@ -10,7 +10,7 @@ .. com.minres.scviewer.e4.product - 2.6.1-SNAPSHOT + 2.7.0-SNAPSHOT eclipse-repository com.minres.scviewer diff --git a/com.minres.scviewer.e4.product/scviewer.product b/com.minres.scviewer.e4.product/scviewer.product index e44db74..a6fafc2 100644 --- a/com.minres.scviewer.e4.product/scviewer.product +++ b/com.minres.scviewer.e4.product/scviewer.product @@ -1,7 +1,7 @@ - + @@ -17,7 +17,6 @@ - diff --git a/features/com.minres.scviewer.database.feature/feature.xml b/features/com.minres.scviewer.database.feature/feature.xml index 72e69a7..f9100b4 100644 --- a/features/com.minres.scviewer.database.feature/feature.xml +++ b/features/com.minres.scviewer.database.feature/feature.xml @@ -29,26 +29,12 @@ http://www.eclipse.org/legal/epl-v10.html + - - - - - - - - - - - - - - - - @@ -51,17 +50,15 @@ - - - + + - @@ -52,7 +52,6 @@ http://www.eclipse.org/legal/epl-v10.html - - + + + + + + + + + + + 2.0.0-SNAPSHOT ../.. - 2.2.0-SNAPSHOT + 2.3.0-SNAPSHOT diff --git a/plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/GotoDirection.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/GotoDirection.java similarity index 100% rename from plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/GotoDirection.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/GotoDirection.java diff --git a/plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/ICursor.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/ICursor.java similarity index 100% rename from plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/ICursor.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/ICursor.java diff --git a/plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/IWaveformView.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/IWaveformView.java similarity index 94% rename from plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/IWaveformView.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/IWaveformView.java index 2d8e85b..c3eeb49 100644 --- a/plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/IWaveformView.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/IWaveformView.java @@ -51,7 +51,9 @@ public interface IWaveformView extends PropertyChangeListener, ISelectionProvide public void setSelection(ISelection selection); - public void setSelection(ISelection selection, boolean addIfNeeded); + public void setSelection(ISelection selection, boolean showIfNeeded); + + public void addToSelection(ISelection selection, boolean showIfNeeded); public void moveSelection(GotoDirection direction); @@ -110,4 +112,6 @@ public interface IWaveformView extends PropertyChangeListener, ISelectionProvide public void scrollHorizontal(int percent); public void addDisposeListener( DisposeListener listener ); + + public void deleteSelectedTracks(); } \ No newline at end of file diff --git a/plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/IWaveformViewFactory.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/IWaveformViewFactory.java similarity index 100% rename from plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/IWaveformViewFactory.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/IWaveformViewFactory.java diff --git a/plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/TrackEntry.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/TrackEntry.java similarity index 100% rename from plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/TrackEntry.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/TrackEntry.java diff --git a/plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/WaveformColors.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/WaveformColors.java similarity index 100% rename from plugins/com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/WaveformColors.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/WaveformColors.java diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/Constants.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/Constants.java similarity index 88% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/Constants.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/Constants.java index 4abb67c..31b43eb 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/Constants.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/Constants.java @@ -1,4 +1,4 @@ -package com.minres.scviewer.database.swt; +package com.minres.scviewer.database.ui.swt; public class Constants { diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/DatabaseUiPlugin.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/DatabaseUiPlugin.java similarity index 96% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/DatabaseUiPlugin.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/DatabaseUiPlugin.java index 84ed5cc..f274d1d 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/DatabaseUiPlugin.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/DatabaseUiPlugin.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt; +package com.minres.scviewer.database.ui.swt; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/ToolTipContentProvider.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/ToolTipContentProvider.java similarity index 80% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/ToolTipContentProvider.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/ToolTipContentProvider.java index 6d46a31..c9c2f6a 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/ToolTipContentProvider.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/ToolTipContentProvider.java @@ -1,4 +1,4 @@ -package com.minres.scviewer.database.swt; +package com.minres.scviewer.database.ui.swt; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Composite; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/ToolTipHelpTextProvider.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/ToolTipHelpTextProvider.java similarity index 83% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/ToolTipHelpTextProvider.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/ToolTipHelpTextProvider.java index 8892b80..524751c 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/ToolTipHelpTextProvider.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/ToolTipHelpTextProvider.java @@ -1,4 +1,4 @@ -package com.minres.scviewer.database.swt; +package com.minres.scviewer.database.ui.swt; import org.eclipse.swt.widgets.Widget; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/WaveformViewFactory.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/WaveformViewFactory.java similarity index 88% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/WaveformViewFactory.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/WaveformViewFactory.java index 3401c24..cb197dc 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/WaveformViewFactory.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/WaveformViewFactory.java @@ -8,13 +8,13 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt; +package com.minres.scviewer.database.ui.swt; import org.eclipse.swt.widgets.Composite; -import com.minres.scviewer.database.swt.internal.WaveformView; import com.minres.scviewer.database.ui.IWaveformView; import com.minres.scviewer.database.ui.IWaveformViewFactory; +import com.minres.scviewer.database.ui.swt.internal.WaveformView; public class WaveformViewFactory implements IWaveformViewFactory { diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ArrowPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java similarity index 99% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ArrowPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java index 4a65f2c..966dc9f 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ArrowPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.util.Collection; import java.util.LinkedList; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/CursorPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/CursorPainter.java similarity index 97% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/CursorPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/CursorPainter.java index 4559d2d..1c5719f 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/CursorPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/CursorPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Rectangle; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/IPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/IPainter.java similarity index 92% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/IPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/IPainter.java index d093f71..745ec5e 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/IPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/IPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import org.eclipse.swt.graphics.Rectangle; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/IWaveformPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/IWaveformPainter.java similarity index 93% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/IWaveformPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/IWaveformPainter.java index 16ec992..da1c814 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/IWaveformPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/IWaveformPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import com.minres.scviewer.database.ui.TrackEntry; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ObservableList.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ObservableList.java similarity index 99% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ObservableList.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ObservableList.java index 8972ac0..9adfe03 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ObservableList.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ObservableList.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/Projection.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/Projection.java similarity index 98% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/Projection.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/Projection.java index 79c68c9..d13aaca 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/Projection.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/Projection.java @@ -1,4 +1,4 @@ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.util.Arrays; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/RelSelectionDialog.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/RelSelectionDialog.java similarity index 97% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/RelSelectionDialog.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/RelSelectionDialog.java index fc53660..28c7d97 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/RelSelectionDialog.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/RelSelectionDialog.java @@ -1,4 +1,4 @@ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/RulerPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/RulerPainter.java similarity index 98% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/RulerPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/RulerPainter.java index 9d5f52e..85c0364 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/RulerPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/RulerPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.text.DecimalFormat; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/SignalPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/SignalPainter.java similarity index 99% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/SignalPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/SignalPainter.java index 883bfc6..4672582 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/SignalPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/SignalPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.util.Collection; import java.util.Map.Entry; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/StreamPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/StreamPainter.java similarity index 99% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/StreamPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/StreamPainter.java index 4d36c2b..289e1f8 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/StreamPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/StreamPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.util.Collection; import java.util.List; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ToolTipHandler.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ToolTipHandler.java similarity index 94% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ToolTipHandler.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ToolTipHandler.java index c6b448c..b86ad5b 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/ToolTipHandler.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ToolTipHandler.java @@ -1,4 +1,4 @@ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Point; @@ -13,9 +13,9 @@ import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Widget; -import com.minres.scviewer.database.swt.Constants; -import com.minres.scviewer.database.swt.ToolTipContentProvider; -import com.minres.scviewer.database.swt.ToolTipHelpTextProvider; +import com.minres.scviewer.database.ui.swt.Constants; +import com.minres.scviewer.database.ui.swt.ToolTipContentProvider; +import com.minres.scviewer.database.ui.swt.ToolTipHelpTextProvider; class ToolTipHandler { diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/TrackAreaPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/TrackAreaPainter.java similarity index 97% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/TrackAreaPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/TrackAreaPainter.java index 0820afd..0ffaf35 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/TrackAreaPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/TrackAreaPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.util.Map.Entry; import java.util.TreeMap; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/TrackPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/TrackPainter.java similarity index 95% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/TrackPainter.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/TrackPainter.java index 9fa285c..762d505 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/TrackPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/TrackPainter.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import com.minres.scviewer.database.ui.TrackEntry; diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/WaveformCanvas.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformCanvas.java similarity index 99% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/WaveformCanvas.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformCanvas.java index c20038d..1a105e9 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/WaveformCanvas.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformCanvas.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.util.ArrayList; import java.util.HashMap; @@ -40,10 +40,10 @@ import com.google.common.collect.Lists; import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.RelationType; -import com.minres.scviewer.database.swt.Constants; import com.minres.scviewer.database.ui.IWaveformView; import com.minres.scviewer.database.ui.TrackEntry; import com.minres.scviewer.database.ui.WaveformColors; +import com.minres.scviewer.database.ui.swt.Constants; public class WaveformCanvas extends Canvas { diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/WaveformView.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformView.java similarity index 89% rename from plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/WaveformView.java rename to plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformView.java index bff0e80..23273d2 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/WaveformView.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformView.java @@ -8,7 +8,7 @@ * Contributors: * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ -package com.minres.scviewer.database.swt.internal; +package com.minres.scviewer.database.ui.swt.internal; import java.awt.Color; import java.beans.PropertyChangeEvent; @@ -86,12 +86,12 @@ import com.minres.scviewer.database.ITxRelation; import com.minres.scviewer.database.ITxStream; import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.RelationType; -import com.minres.scviewer.database.swt.Constants; import com.minres.scviewer.database.ui.GotoDirection; import com.minres.scviewer.database.ui.ICursor; import com.minres.scviewer.database.ui.IWaveformView; import com.minres.scviewer.database.ui.TrackEntry; import com.minres.scviewer.database.ui.WaveformColors; +import com.minres.scviewer.database.ui.swt.Constants; public class WaveformView implements IWaveformView { @@ -103,7 +103,7 @@ public class WaveformView implements IWaveformView { private ITx currentTxSelection; - private TrackEntry currentWaveformSelection; + private ArrayList currentWaveformSelection = new ArrayList<>(); private ScrolledComposite nameListScrolled; @@ -133,18 +133,41 @@ public class WaveformView implements IWaveformView { private Font nameFont, nameFontB; + protected TrackEntry lastClickedEntry; + protected MouseListener nameValueMouseListener = new MouseAdapter() { + @Override public void mouseDown(MouseEvent e) { if (e.button == 1) { Entry entry = trackVerticalOffset.floorEntry(e.y); - if (entry != null) - setSelection(new StructuredSelection(entry.getValue())); + entry.getValue().selected=true; } else if (e.button == 3) { Menu topMenu= top.getMenu(); if(topMenu!=null) topMenu.setVisible(true); } } + + @Override + public void mouseUp(MouseEvent e) { + if (e.button == 1) { + Entry entry = trackVerticalOffset.floorEntry(e.y); + if (entry != null) { + if((e.stateMask & SWT.SHIFT) != 0) { + if(lastClickedEntry.selected) { + int firstIdx=streams.indexOf(lastClickedEntry); + int lastIdx = streams.indexOf(entry.getValue()); + List res = firstIdx>lastIdx?streams.subList(lastIdx, firstIdx+1):streams.subList(firstIdx, lastIdx+1); + setSelection(new StructuredSelection(res), (e.stateMask & SWT.CTRL) !=0 , false); + } else + setSelection(new StructuredSelection(entry.getValue()), (e.stateMask & SWT.CTRL) !=0 , false); + } else { + setSelection(new StructuredSelection(entry.getValue()), (e.stateMask & SWT.CTRL) !=0 , false); + } + } + lastClickedEntry = entry.getValue(); + } + } }; class WaveformMouseListener implements MouseMoveListener, MouseListener, PaintListener { @@ -457,7 +480,7 @@ public class WaveformView implements IWaveformView { @Override public void run() { update(); - waveformCanvas.reveal(currentWaveformSelection.waveform); + currentWaveformSelection.stream().forEach(e -> waveformCanvas.reveal(e.waveform)); valueList.redraw(); nameList.redraw(); } @@ -480,13 +503,11 @@ public class WaveformView implements IWaveformView { trackVerticalOffset.clear(); waveformCanvas.clearAllWaveformPainter(false); boolean even = true; - boolean clearSelection = true; TextLayout tl = new TextLayout(waveformCanvas.getDisplay()); tl.setFont(nameFontB); for (TrackEntry streamEntry : streams) { streamEntry.height = waveformCanvas.getTrackHeight(); streamEntry.vOffset=trackVerticalHeight; - clearSelection &= currentWaveformSelection!=null && (streamEntry.waveform != currentWaveformSelection.waveform); if (streamEntry.isStream()) { streamEntry.currentValue=""; streamEntry.height *= streamEntry.getStream().getMaxConcurrency(); @@ -512,7 +533,6 @@ public class WaveformView implements IWaveformView { if (trackVerticalOffset.isEmpty()){ waveformCanvas.setOrigin(0, 0); } - if(clearSelection) setSelection(new StructuredSelection()); } private int calculateValueWidth() { @@ -651,11 +671,12 @@ public class WaveformView implements IWaveformView { @Override public ISelection getSelection() { if (currentTxSelection != null) { - Object[] elem = {currentTxSelection, currentWaveformSelection}; - return new StructuredSelection(elem); - } else if (currentWaveformSelection != null) { - Object[] elem = {currentWaveformSelection.waveform, currentWaveformSelection}; - return new StructuredSelection(elem); + ArrayList sel = new ArrayList<>(); + sel.add(currentTxSelection); + sel.addAll(currentWaveformSelection.stream().map(e -> e.waveform).collect(Collectors.toList())); + return new StructuredSelection(sel.toArray()); + } else if (currentWaveformSelection.size()>0) { + return new StructuredSelection(currentWaveformSelection.toArray()); } else return new StructuredSelection(); } @@ -665,22 +686,33 @@ public class WaveformView implements IWaveformView { */ @Override public void setSelection(ISelection selection) { - setSelection(selection, false); + setSelection(selection, false, false); } - /* (non-Javadoc) * @see com.minres.scviewer.database.swt.IWaveformPanel#setSelection(org.eclipse.jface.viewers.ISelection, boolean) */ @Override - public void setSelection(ISelection selection, boolean addIfNeeded) { + public void setSelection(ISelection selection, boolean showIfNeeded) { + setSelection(selection, false, showIfNeeded); + } + /* (non-Javadoc) + * @see com.minres.scviewer.database.swt.IWaveformPanel#addToSelection(org.eclipse.jface.viewers.ISelection, boolean) + */ + @Override + public void addToSelection(ISelection selection, boolean showIfNeeded) { + setSelection(selection, true, showIfNeeded); + } + + public void setSelection(ISelection selection, boolean add, boolean addIfNeeded) { boolean selectionChanged = false; - if(currentWaveformSelection!=null) currentWaveformSelection.selected=false; + currentWaveformSelection.forEach(e->e.selected=false); if (selection instanceof IStructuredSelection) { if(((IStructuredSelection) selection).size()==0){ selectionChanged = currentTxSelection!=null||currentWaveformSelection!=null; currentTxSelection = null; - currentWaveformSelection = null; + currentWaveformSelection .clear(); } else { + if(!add) currentWaveformSelection.clear(); for(Object sel:((IStructuredSelection) selection).toArray()){ if (sel instanceof ITx && currentTxSelection != sel){ ITx txSel = (ITx) sel; @@ -693,26 +725,27 @@ public class WaveformView implements IWaveformView { streams.add(trackEntry); } currentTxSelection = txSel; - if(trackEntry!=null) currentWaveformSelection = trackEntry; + if(trackEntry!=null) { + currentWaveformSelection.add((TrackEntry)sel); + } selectionChanged = true; - } else if (sel instanceof TrackEntry && currentWaveformSelection != sel) { - currentWaveformSelection = (TrackEntry) sel; - if(currentTxSelection!=null && currentTxSelection.getStream()!=currentWaveformSelection) - currentTxSelection=null; - + } else if (sel instanceof TrackEntry && !currentWaveformSelection.contains(sel)) { + currentWaveformSelection.add((TrackEntry)sel); + if(currentTxSelection!=null) + currentTxSelection=null; selectionChanged = true; } } } } else { - if (currentTxSelection != null || currentWaveformSelection != null) + if (currentTxSelection != null || currentWaveformSelection.size() > 0) selectionChanged = true; currentTxSelection = null; - currentWaveformSelection = null; + currentWaveformSelection.clear(); } - if(currentWaveformSelection!=null) currentWaveformSelection.selected=true; + currentWaveformSelection.forEach(e -> e.selected = true); if (selectionChanged) { - if(currentWaveformSelection!=null) waveformCanvas.reveal(currentWaveformSelection.waveform); + currentWaveformSelection.forEach(e -> waveformCanvas.reveal(e.waveform)); waveformCanvas.setSelected(currentTxSelection); valueList.redraw(); nameList.redraw(); @@ -722,13 +755,11 @@ public class WaveformView implements IWaveformView { protected void fireSelectionChanged() { if(currentWaveformSelection==null) return; - IStructuredSelection selection=currentTxSelection!=null? - new StructuredSelection(new Object[]{currentTxSelection, currentWaveformSelection.waveform}): - new StructuredSelection(currentWaveformSelection.waveform); - Object[] list = selectionChangedListeners.getListeners(); - for (int i = 0; i < list.length; i++) { - ((ISelectionChangedListener) list[i]).selectionChanged(new SelectionChangedEvent(this, selection)); - } + ISelection selection=getSelection(); + Object[] list = selectionChangedListeners.getListeners(); + for (int i = 0; i < list.length; i++) { + ((ISelectionChangedListener) list[i]).selectionChanged(new SelectionChangedEvent(this, selection)); + } } /* (non-Javadoc) @@ -739,12 +770,14 @@ public class WaveformView implements IWaveformView { if(direction==GotoDirection.NEXT || direction==GotoDirection.PREV) moveSelection(direction, NEXT_PREV_IN_STREAM) ; else { - int idx = streams.indexOf(currentWaveformSelection); + if(currentWaveformSelection.size()==1) { + int idx = streams.indexOf(currentWaveformSelection.get(0)); if(direction==GotoDirection.UP && idx>0) { setSelection(new StructuredSelection(streams.get(idx-1))); } else if(direction==GotoDirection.DOWN && idx<(streams.size()-1)) { setSelection(new StructuredSelection(streams.get(idx+1))); } + } } } @@ -753,9 +786,15 @@ public class WaveformView implements IWaveformView { */ @Override public void moveSelection(GotoDirection direction, RelationType relationType) { - if (currentWaveformSelection!=null && currentWaveformSelection.isStream() && currentTxSelection!=null) { + TrackEntry selectedWaveform=null; + if(currentTxSelection!=null) + selectedWaveform = getEntryForStream(currentTxSelection.getStream()); + else if(currentWaveformSelection.size()!=1) return; + if(selectedWaveform==null) + selectedWaveform = currentWaveformSelection.get(1); + if (selectedWaveform!=null && selectedWaveform.isStream() && currentTxSelection!=null) { if(relationType.equals(IWaveformView.NEXT_PREV_IN_STREAM)){ - ITxStream stream = currentWaveformSelection.getStream(); + ITxStream stream = selectedWaveform.getStream(); ITx transaction = null; if (direction == GotoDirection.NEXT) { List thisEntryList = stream.getEvents().get(currentTxSelection.getBeginTime()); @@ -855,14 +894,14 @@ public class WaveformView implements IWaveformView { */ @Override public void moveCursor(GotoDirection direction) { + if(currentWaveformSelection.size()!=1) return; + TrackEntry sel = currentWaveformSelection.get(1); long time = getCursorTime(); NavigableMap map=null; - if(currentWaveformSelection!=null) { - if(currentWaveformSelection.isStream()){ - map=currentWaveformSelection.getStream().getEvents(); - } else if(currentWaveformSelection.isSignal()){ - map=currentWaveformSelection.getSignal().getEvents(); - } + if(sel.isStream()){ + map=sel.getStream().getEvents(); + } else if(sel.isSignal()){ + map=sel.getSignal().getEvents(); } if(map!=null){ Entry entry=direction==GotoDirection.PREV?map.lowerEntry(time):map.higherEntry(time); @@ -884,29 +923,37 @@ public class WaveformView implements IWaveformView { public List getStreamList() { return streams; } - + /* (non-Javadoc) + * @see com.minres.scviewer.database.swt.IWaveformPanel#deleteSelectedTracks() + */ + @Override + public void deleteSelectedTracks() { + List streams = getStreamList(); + for (Object o : (IStructuredSelection)getSelection()) { + if(o instanceof TrackEntry) { + TrackEntry e = (TrackEntry) o; + e.selected=false; + streams.remove(e); + } + } + setSelection(new StructuredSelection()); + update(); + } /* (non-Javadoc) * @see com.minres.scviewer.database.swt.IWaveformPanel#moveSelected(int) */ @Override public void moveSelectedTrack(int i) { - if(currentWaveformSelection!=null){ - int idx = streams.indexOf(currentWaveformSelection); - int newIdx=idx+i; - if(newIdx>=0 && newIdx0){ + int idx = streams.indexOf(currentWaveformSelection.get(0)); + for(Object o: currentWaveformSelection) + streams.remove(o); + int tgtIdx=idx+i; + if(tgtIdx<0) tgtIdx=0; + if(tgtIdx>=streams.size()) + streams.addAll(currentWaveformSelection); + else + streams.addAll(tgtIdx, currentWaveformSelection); } } @@ -1108,38 +1155,30 @@ public class WaveformView implements IWaveformView { dropTarget.setTransfer(types); dropTarget.addDropListener(new DropTargetAdapter() { + @SuppressWarnings("unchecked") public void drop(DropTargetEvent event) { if (LocalSelectionTransfer.getTransfer().isSupportedType(event.currentDataType)){ - ISelection sel = LocalSelectionTransfer.getTransfer().getSelection(); - if(sel!=null && sel instanceof IStructuredSelection){ - Object source = ((IStructuredSelection)sel).getFirstElement(); + ISelection s = LocalSelectionTransfer.getTransfer().getSelection(); + if(s!=null && s instanceof IStructuredSelection){ + IStructuredSelection sel = (IStructuredSelection) s; + for(Object o: sel.toList()) + streams.remove(o); DropTarget tgt = (DropTarget) event.widget; Point dropPoint = ((Canvas) tgt.getControl()).toControl(event.x, event.y); - Object target = trackVerticalOffset.floorEntry(dropPoint.y).getValue(); - if(source instanceof TrackEntry && target instanceof TrackEntry){ - TrackEntry srcWave=(TrackEntry) source; - int srcIdx=streams.indexOf(srcWave); - streams.remove(srcWave); + // extract all elements being selected + if( dropPoint.y > trackVerticalOffset.lastKey()) { + streams.addAll(sel.toList()); + } else { + TrackEntry target = trackVerticalOffset.floorEntry(dropPoint.y).getValue(); int tgtIdx=streams.indexOf(target); - if(srcIdx<=tgtIdx) tgtIdx++; - if(tgtIdx>=streams.size()) - streams.add(srcWave); - else - streams.add(tgtIdx, srcWave); - currentWaveformSelection=srcWave; - update(); - } else if(source instanceof CursorPainter){ - ((CursorPainter)source).setTime(0); - updateValueList(); - } + streams.addAll(tgtIdx, sel.toList()); + } } } } - public void dropAccept(DropTargetEvent event) { - Point offset = canvas.toControl(event.x, event.y); - if (event.detail != DND.DROP_MOVE || offset.y > trackVerticalOffset.lastKey() + waveformCanvas.getTrackHeight()) { + if (event.detail != DND.DROP_MOVE) { event.detail = DND.DROP_NONE; } } @@ -1350,4 +1389,5 @@ public class WaveformView implements IWaveformView { public void addDisposeListener( DisposeListener listener ) { waveformCanvas.addDisposeListener(listener); } + } diff --git a/plugins/com.minres.scviewer.database.ui/.classpath b/plugins/com.minres.scviewer.database.ui/.classpath deleted file mode 100644 index eca7bdb..0000000 --- a/plugins/com.minres.scviewer.database.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/com.minres.scviewer.database.ui/.gitignore b/plugins/com.minres.scviewer.database.ui/.gitignore deleted file mode 100644 index 09e3bc9..0000000 --- a/plugins/com.minres.scviewer.database.ui/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/plugins/com.minres.scviewer.database.ui/.project b/plugins/com.minres.scviewer.database.ui/.project deleted file mode 100644 index 4133603..0000000 --- a/plugins/com.minres.scviewer.database.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - com.minres.scviewer.database.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/plugins/com.minres.scviewer.database.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/com.minres.scviewer.database.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0c68a61..0000000 --- a/plugins/com.minres.scviewer.database.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/plugins/com.minres.scviewer.database.ui/.settings/org.eclipse.pde.core.prefs b/plugins/com.minres.scviewer.database.ui/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index f29e940..0000000 --- a/plugins/com.minres.scviewer.database.ui/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -pluginProject.extensions=false -resolve.requirebundle=false diff --git a/plugins/com.minres.scviewer.database.ui/META-INF/MANIFEST.MF b/plugins/com.minres.scviewer.database.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 91e16dc..0000000 --- a/plugins/com.minres.scviewer.database.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,12 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Database UI -Bundle-SymbolicName: com.minres.scviewer.database.ui -Bundle-Version: 2.0.0.qualifier -Bundle-Vendor: MINRES Technologies GmbH -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: com.minres.scviewer.database.ui -Require-Bundle: com.minres.scviewer.database, - org.eclipse.jface, - org.eclipse.swt -Automatic-Module-Name: com.minres.scviewer.database.ui diff --git a/plugins/com.minres.scviewer.database.ui/build.properties b/plugins/com.minres.scviewer.database.ui/build.properties deleted file mode 100644 index 34d2e4d..0000000 --- a/plugins/com.minres.scviewer.database.ui/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/plugins/com.minres.scviewer.database.ui/pom.xml b/plugins/com.minres.scviewer.database.ui/pom.xml deleted file mode 100644 index f166629..0000000 --- a/plugins/com.minres.scviewer.database.ui/pom.xml +++ /dev/null @@ -1,12 +0,0 @@ - - 4.0.0 - com.minres.scviewer.database.ui - 2.0.0-SNAPSHOT - eclipse-plugin - - com.minres.scviewer - com.minres.scviewer.parent - 2.0.0-SNAPSHOT - ../.. - - 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 a8da3e0..bf702cb 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.6.1.qualifier +Bundle-Version: 2.7.0.qualifier Bundle-Vendor: %Bundle-Vendor Require-Bundle: javax.inject;bundle-version="1.0.0", org.eclipse.core.runtime;bundle-version="3.11.1", @@ -15,7 +15,6 @@ Require-Bundle: javax.inject;bundle-version="1.0.0", org.eclipse.e4.ui.di;bundle-version="1.1.0", org.eclipse.e4.core.contexts;bundle-version="1.4.0", com.minres.scviewer.database.ui.swt;bundle-version="1.0.0", - com.minres.scviewer.database.ui, com.minres.scviewer.database;bundle-version="1.0.0", org.eclipse.osgi.services;bundle-version="3.5.0", org.eclipse.e4.core.services;bundle-version="2.0.0", diff --git a/plugins/com.minres.scviewer.e4.application/pom.xml b/plugins/com.minres.scviewer.e4.application/pom.xml index 158788b..ff43e97 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.6.1-SNAPSHOT + 2.7.0-SNAPSHOT com.minres.scviewer com.minres.scviewer.parent diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/WaveformPopupMenuContribution.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/WaveformPopupMenuContribution.java index b4e9228..bdf0e15 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/WaveformPopupMenuContribution.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/elements/WaveformPopupMenuContribution.java @@ -1,7 +1,6 @@ package com.minres.scviewer.e4.application.elements; -import java.util.Iterator; import java.util.List; import javax.inject.Inject; @@ -34,22 +33,46 @@ public class WaveformPopupMenuContribution { final TrackEntry nullEntry = new TrackEntry(null); + private boolean selHasBitVector(ISelection sel, boolean checkForDouble) { + if(!sel.isEmpty() && sel instanceof IStructuredSelection) { + for(Object elem:(IStructuredSelection)sel) { + if(elem instanceof TrackEntry) { + TrackEntry e = (TrackEntry) elem; + if(e.waveform instanceof ISignal) { + Object o = ((ISignal) e.waveform).getEvents().firstEntry().getValue(); + if(checkForDouble && o instanceof Double) + return true; + else if(o instanceof BitVector && ((BitVector)o).getWidth()>1) + return true; + else + return false; + } + } + } + } + return false; + } + + private TrackEntry getSingleTrackEntry(ISelection sel) { + TrackEntry entry=null; + if(!sel.isEmpty() && sel instanceof IStructuredSelection) { + for(Object elem:(IStructuredSelection)sel) { + if(elem instanceof TrackEntry) { + if(entry != null) + return null; + entry = (TrackEntry) elem; + } + } + } + return entry; + } + @Evaluate public boolean evaluate() { Object obj = activePart.getObject(); if(obj instanceof WaveformViewer){ WaveformViewer wfv = (WaveformViewer)obj; - ISelection sel = wfv.getSelection(); - if(!sel.isEmpty() && sel instanceof IStructuredSelection) { - Object selected = ((IStructuredSelection)sel).getFirstElement(); - if(selected instanceof ISignal) { - Object x = ((ISignal) selected).getEvents().firstEntry().getValue(); - if((x instanceof BitVector) && ((BitVector)x).getWidth()==1) { - return false; - } else - return true; - } - } + return selHasBitVector(wfv.getSelection(), true); } return false; } @@ -60,39 +83,24 @@ public class WaveformPopupMenuContribution { if(obj instanceof WaveformViewer){ WaveformViewer wfv = (WaveformViewer)obj; ISelection sel = wfv.getSelection(); - if(!sel.isEmpty() && sel instanceof IStructuredSelection) { - Iterator it = ((IStructuredSelection)sel).iterator(); - Object first = it.next(); - Object second=null; - if(it.hasNext()) second=it.next(); - if(first instanceof ISignal) { - Object o = ((ISignal) first).getEvents().firstEntry().getValue(); - //com.minres.scviewer.e4.application.menu.mulitvaluesettings - if((o instanceof Double) || (o instanceof BitVector)) { - TrackEntry entry=nullEntry; - if(second instanceof TrackEntry) - entry=(TrackEntry)second; - if(o instanceof BitVector) { - addValueMenuItem(items, application, modelService, "hex", TrackEntry.ValueDisplay.DEFAULT, entry.valueDisplay); - addValueMenuItem(items, application, modelService, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, entry.valueDisplay); - addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, entry.valueDisplay); - items.add(MMenuFactory.INSTANCE.createMenuSeparator()); - addWaveMenuItem(items, application, modelService, "bit vector", TrackEntry.WaveDisplay.DEFAULT, entry.waveDisplay); - } - addWaveMenuItem(items, application, modelService, "analog step-wise", TrackEntry.WaveDisplay.STEP_WISE, entry.waveDisplay); - addWaveMenuItem(items, application, modelService, "analog continous", TrackEntry.WaveDisplay.CONTINOUS, entry.waveDisplay); - } - } - } + TrackEntry elem = getSingleTrackEntry(sel); + if(selHasBitVector(sel, false)) { + addValueMenuItem(items, application, modelService, "hex", TrackEntry.ValueDisplay.DEFAULT, elem); + addValueMenuItem(items, application, modelService, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, elem); + addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, elem); + items.add(MMenuFactory.INSTANCE.createMenuSeparator()); + addWaveMenuItem(items, application, modelService, "bit vector", TrackEntry.WaveDisplay.DEFAULT, elem); + } + addWaveMenuItem(items, application, modelService, "analog step-wise", TrackEntry.WaveDisplay.STEP_WISE, elem); + addWaveMenuItem(items, application, modelService, "analog continous", TrackEntry.WaveDisplay.CONTINOUS, elem); } - } private void addValueMenuItem(List items, MApplication application, EModelService modelService, - String label, TrackEntry.ValueDisplay value, TrackEntry.ValueDisplay actual) { + String label, TrackEntry.ValueDisplay value, TrackEntry elem) { MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem(); item.setType(ItemType.RADIO); - item.setSelected(value==actual); + item.setSelected(elem != null && elem.valueDisplay == value); item.setLabel("Show as "+label); item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application"); List cmds = modelService.findElements(application, "com.minres.scviewer.e4.application.command.changevaluedisplay", MCommand.class, null); @@ -106,10 +114,10 @@ public class WaveformPopupMenuContribution { } private void addWaveMenuItem(List items, MApplication application, EModelService modelService, - String label, TrackEntry.WaveDisplay value, TrackEntry.WaveDisplay actual) { + String label, TrackEntry.WaveDisplay value, TrackEntry elem) { MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem(); item.setType(ItemType.RADIO); - item.setSelected(value==actual); + item.setSelected(elem != null && elem.waveDisplay==value); item.setLabel("Render "+label); item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application"); List cmds = modelService.findElements(application, "com.minres.scviewer.e4.application.command.changewavedisplay", MCommand.class, null); diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ChangeValueDisplay.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ChangeValueDisplay.java index caaf007..6ca3d00 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ChangeValueDisplay.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ChangeValueDisplay.java @@ -1,8 +1,6 @@ package com.minres.scviewer.e4.application.handlers; -import java.util.Iterator; - import javax.inject.Named; import org.eclipse.e4.core.di.annotations.CanExecute; @@ -34,18 +32,14 @@ public class ChangeValueDisplay { WaveformViewer wfv = (WaveformViewer)obj; ISelection sel = wfv.getSelection(); if(!sel.isEmpty() && sel instanceof IStructuredSelection) { - Iterator it = ((IStructuredSelection)sel).iterator(); - it.next(); - if(it.hasNext()) { - Object second = it.next(); - if(second instanceof TrackEntry) { - TrackEntry.ValueDisplay val = TrackEntry.ValueDisplay.valueOf(param); - ((TrackEntry)second).valueDisplay=val; - wfv.update(); - } + for(Object elem:(IStructuredSelection)sel) { + if(elem instanceof TrackEntry) { + TrackEntry.ValueDisplay val= TrackEntry.ValueDisplay.valueOf(param); + ((TrackEntry)elem).valueDisplay=val; + } } + wfv.update(); } } } - } \ No newline at end of file diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ChangeWaveformDisplay.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ChangeWaveformDisplay.java index c4af6c0..6f87784 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ChangeWaveformDisplay.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ChangeWaveformDisplay.java @@ -1,8 +1,6 @@ package com.minres.scviewer.e4.application.handlers; -import java.util.Iterator; - import javax.inject.Named; import org.eclipse.e4.core.di.annotations.CanExecute; @@ -34,16 +32,13 @@ public class ChangeWaveformDisplay { WaveformViewer wfv = (WaveformViewer)obj; ISelection sel = wfv.getSelection(); if(!sel.isEmpty() && sel instanceof IStructuredSelection) { - Iterator it = ((IStructuredSelection)sel).iterator(); - it.next(); - if(it.hasNext()) { - Object second = it.next(); - if(second instanceof TrackEntry) { - TrackEntry.WaveDisplay val= TrackEntry.WaveDisplay.valueOf(param); - ((TrackEntry)second).waveDisplay=val; - wfv.update(); - } + for(Object elem:(IStructuredSelection)sel) { + if(elem instanceof TrackEntry) { + TrackEntry.WaveDisplay val= TrackEntry.WaveDisplay.valueOf(param); + ((TrackEntry)elem).waveDisplay=val; + } } + wfv.update(); } } } diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/DeleteWaveformHandler.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/DeleteWaveformHandler.java index e84a6b5..badbf5d 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/DeleteWaveformHandler.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/DeleteWaveformHandler.java @@ -17,23 +17,30 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.e4.ui.workbench.modeling.ESelectionService; import org.eclipse.jface.viewers.IStructuredSelection; -import com.minres.scviewer.database.IWaveform; +import com.minres.scviewer.database.ui.TrackEntry; import com.minres.scviewer.e4.application.parts.WaveformViewer; public class DeleteWaveformHandler { + @SuppressWarnings("unchecked") @CanExecute public Boolean canExecute(ESelectionService selectionService){ Object o = selectionService.getSelection(); - return o instanceof IStructuredSelection && ((IStructuredSelection)o).getFirstElement() instanceof IWaveform; + if(o instanceof IStructuredSelection) { + IStructuredSelection sel = (IStructuredSelection) o; + if(sel.size()>0) + return sel.toList().stream().allMatch(e-> e instanceof TrackEntry); + else + return false; + } else + return false; } @Execute public void execute(ESelectionService selectionService, MPart activePart) { Object o = activePart.getObject(); - Object sel = selectionService.getSelection(); - if(o instanceof WaveformViewer && ((IStructuredSelection)sel).getFirstElement() instanceof IWaveform){ - ((WaveformViewer)o).removeStreamFromList((IWaveform) ((IStructuredSelection)sel).getFirstElement()); + if(o instanceof WaveformViewer){ + ((WaveformViewer)o).removeSelectedStreamsFromList(); } } } \ No newline at end of file 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 193a29d..fbdca9d 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 @@ -90,16 +90,16 @@ import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.IWaveformDb; import com.minres.scviewer.database.IWaveformDbFactory; import com.minres.scviewer.database.RelationType; -import com.minres.scviewer.database.swt.Constants; -import com.minres.scviewer.database.swt.ToolTipContentProvider; -import com.minres.scviewer.database.swt.ToolTipHelpTextProvider; -import com.minres.scviewer.database.swt.WaveformViewFactory; import com.minres.scviewer.database.ui.GotoDirection; import com.minres.scviewer.database.ui.ICursor; import com.minres.scviewer.database.ui.IWaveformView; import com.minres.scviewer.database.ui.TrackEntry; import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay; import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay; +import com.minres.scviewer.database.ui.swt.Constants; +import com.minres.scviewer.database.ui.swt.ToolTipContentProvider; +import com.minres.scviewer.database.ui.swt.ToolTipHelpTextProvider; +import com.minres.scviewer.database.ui.swt.WaveformViewFactory; import com.minres.scviewer.database.ui.WaveformColors; import com.minres.scviewer.e4.application.Messages; import com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl; @@ -1005,55 +1005,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis setFocus(); } - /** - * Removes the stream from list. - * - * @param stream the stream - */ - public void removeStreamFromList(IWaveform stream) { - TrackEntry trackEntry = waveformPane.getEntryForStream(stream); - List streams = waveformPane.getStreamList(); - ISelection sel = waveformPane.getSelection(); - TrackEntry newSelection=null; - - if(sel instanceof IStructuredSelection && ((IStructuredSelection) sel).size()==2) { - Iterator it = ((IStructuredSelection)sel).iterator(); - it.next(); - int idx = streams.indexOf(it.next()); - - if(idx==streams.size()-1) { - //last stream gets deleted, no more selection - if(idx==0) { - newSelection=null; - } - //more than 1 stream left, last gets deleted, selection jumps to new last stream - else { - newSelection=streams.get(idx-1); - } - } - //more than 1 stream left, any stream but the last gets deleted, selection jumps to the next stream - else { - newSelection=streams.get(idx+1); - } - } - waveformPane.setSelection(new StructuredSelection()); - streams.remove(trackEntry); - if(newSelection!=null) { - Object[] o = {newSelection}; - waveformPane.setSelection(new StructuredSelection(o)); - } + public void removeSelectedStreamsFromList() { + waveformPane.deleteSelectedTracks(); } - /** - * Removes the streams from list. - * - * @param iWaveforms the i waveforms - */ - public void removeStreamsFromList(IWaveform[] iWaveforms) { - for (IWaveform stream : iWaveforms) - removeStreamFromList(stream); + public void removeStreamFromList(ISelection sel) { + waveformPane.deleteSelectedTracks(); } - /** * Move selected. * diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbContentProvider.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbContentProvider.java index 3c4f46a..725d12b 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbContentProvider.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbContentProvider.java @@ -68,7 +68,9 @@ public class TxDbContentProvider implements ITreeContentProvider { */ @Override public Object[] getElements(Object inputElement) { - if(inputElement instanceof IHierNode){ + if(inputElement instanceof IWaveformDb){ + return new Object[]{}; + }else if(inputElement instanceof IHierNode){ Collection res = Collections2.filter(((IHierNode)inputElement).getChildNodes(), new Predicate(){ @Override public boolean apply(IHierNode arg0) { @@ -82,8 +84,6 @@ public class TxDbContentProvider implements ITreeContentProvider { return res.toArray(); }else if(inputElement instanceof List){ return ((List)inputElement).toArray(); - }else if(inputElement instanceof IWaveformDb){ - return new Object[]{}; } else return null; } diff --git a/plugins/com.minres.scviewer.ui/META-INF/MANIFEST.MF b/plugins/com.minres.scviewer.ui/META-INF/MANIFEST.MF index 60150bc..fe01223 100644 --- a/plugins/com.minres.scviewer.ui/META-INF/MANIFEST.MF +++ b/plugins/com.minres.scviewer.ui/META-INF/MANIFEST.MF @@ -6,7 +6,6 @@ Bundle-Version: 1.0.1.qualifier Bundle-Activator: com.minres.scviewer.ui.TxEditorPlugin Bundle-Vendor: MINRES Technologies GmbH Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0", - com.minres.scviewer.database.ui;bundle-version="1.0.0", com.minres.scviewer.database.ui.swt;bundle-version="1.0.0", org.eclipse.core.runtime, org.eclipse.core.resources, diff --git a/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java b/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java index 4fb6c91..24518bb 100644 --- a/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java +++ b/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java @@ -48,10 +48,10 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.IWaveformDb; import com.minres.scviewer.database.IWaveformDbFactory; -import com.minres.scviewer.database.swt.WaveformViewFactory; import com.minres.scviewer.database.ui.GotoDirection; import com.minres.scviewer.database.ui.IWaveformView; import com.minres.scviewer.database.ui.TrackEntry; +import com.minres.scviewer.database.ui.swt.WaveformViewFactory; import com.minres.scviewer.ui.views.TxOutlinePage; public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPageContributor { diff --git a/pom.xml b/pom.xml index 0130034..44cf0d8 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,6 @@ plugins/com.minres.scviewer.database.text plugins/com.minres.scviewer.database.vcd tests/com.minres.scviewer.database.test - plugins/com.minres.scviewer.database.ui plugins/com.minres.scviewer.database.ui.swt plugins/com.minres.scviewer.e4.application plugins/com.minres.scviewer.ui