diff --git a/com.minres.scviewer.ui/META-INF/MANIFEST.MF b/com.minres.scviewer.ui/META-INF/MANIFEST.MF index 819353b..9d1cdbc 100644 --- a/com.minres.scviewer.ui/META-INF/MANIFEST.MF +++ b/com.minres.scviewer.ui/META-INF/MANIFEST.MF @@ -21,3 +21,4 @@ Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0", Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Import-Package: com.google.common.collect +Service-Component: OSGI-INF/component.xml diff --git a/com.minres.scviewer.ui/OSGI-INF/component.xml b/com.minres.scviewer.ui/OSGI-INF/component.xml new file mode 100644 index 0000000..466e946 --- /dev/null +++ b/com.minres.scviewer.ui/OSGI-INF/component.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/com.minres.scviewer.ui/build.properties b/com.minres.scviewer.ui/build.properties index cf8a4d2..a970161 100644 --- a/com.minres.scviewer.ui/build.properties +++ b/com.minres.scviewer.ui/build.properties @@ -1,17 +1,8 @@ -############################################################################### -# 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 = plugin.xml,\ META-INF/,\ .,\ contexts.xml,\ - res/ -source.. = src/ + res/,\ + OSGI-INF/ jars.compile.order = . +source.. = src/ diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java index 606e817..3f063fb 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java @@ -46,14 +46,25 @@ 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.IWaveformEvent; -import com.minres.scviewer.database.WaveformDb; import com.minres.scviewer.database.swt.GotoDirection; import com.minres.scviewer.database.swt.TxDisplay; import com.minres.scviewer.ui.views.TxOutlinePage; public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPageContributor { + private IWaveformDbFactory waveformDbFactory; + + public synchronized void bind(IWaveformDbFactory factory){ + waveformDbFactory=factory; + } + + public synchronized void unbind(IWaveformDbFactory factory){ + if(waveformDbFactory==factory) + waveformDbFactory=null; + } + private final static String[] zoomLevel={ "1fs", "10fs", "100fs", "1ps", "10ps", "100ps", @@ -85,7 +96,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage @Override public void createPartControl(Composite parent) { myParent=parent; - database=new WaveformDb(); + database=waveformDbFactory.getDatabase(); database.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { @@ -273,7 +284,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage public void doSaveAs() { } - @SuppressWarnings("rawtypes") + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public Object getAdapter(Class type) { if (type == IContentOutlinePage.class) // outline page @@ -382,8 +393,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage } public void removeSelected() { - // TODO Auto-generated method stub - + // TODO TxDisplay needs to be extended } } diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/TxAdapterFactory.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/TxAdapterFactory.java index c5c9cb8..536d724 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/TxAdapterFactory.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/TxAdapterFactory.java @@ -17,7 +17,7 @@ import com.minres.scviewer.database.ITx; public class TxAdapterFactory implements IAdapterFactory { - @SuppressWarnings("rawtypes") + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public Object getAdapter(Object adaptableObject, Class adapterType) { if (adapterType == IPropertySource.class) @@ -25,7 +25,7 @@ public class TxAdapterFactory implements IAdapterFactory { return null; } - @SuppressWarnings("rawtypes") + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public Class[] getAdapterList() { return new Class[]{IPropertySource.class}; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/RemoveHandler.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/RemoveHandler.java index 386d594..266eb75 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/RemoveHandler.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/RemoveHandler.java @@ -7,7 +7,6 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.internal.misc.StringMatcher; import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.IWaveformEvent;