updates target platform to Eclipse 2026-12

This commit is contained in:
eyck committed 2026-11-21 16:32:39 +01:00
1 parent becc24cdb4
commit c112823c27
46 files changed
+151 -140

No files matched your search

@@ -4,6 +4,7 @@ Bundle-Name: SCViewer application tests
Bundle-Vendor: MINRES Technologies GmbH
Bundle-SymbolicName: com.minres.scviewer.e4.application.test
Bundle-Version: 2.20.0
Import-Package: org.osgi.service.event;version="1.4.0"
Fragment-Host: com.minres.scviewer.e4.application
Bundle-RequiredExecutionEnvironment: JavaSE-21
Require-Bundle: org.eclipse.e4.ui.bindings,
@@ -16,6 +16,9 @@ import java.lang.reflect.Proxy;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.EclipseContextFactory;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.jface.viewers.ISelection;
@@ -26,6 +29,7 @@ import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.IWaveformDb;
import com.minres.scviewer.database.WaveformType;
import com.minres.scviewer.database.ui.TrackEntry;
import com.minres.scviewer.database.ui.ZoomKind;
import com.minres.scviewer.e4.application.parts.DesignBrowser;
import com.minres.scviewer.e4.application.parts.WaveformViewer;
@@ -72,6 +76,32 @@ public class CommandHandlersTest {
(proxy, method, args) -> method.getName().equals("getActivePart") ? active.get() : null);
}
@Test
public void preferencesBundleUsesThePlatformInjectionNamespace() {
// OPCoach published Javax and Jakarta builds with the same bundle version.
var bundle = org.eclipse.core.runtime.Platform.getBundle("com.opcoach.e4.preferences");
assertNotNull(bundle);
assertTrue("Refresh the cached OPCoach 1.3.2 artifact from the target repository",
bundle.getHeaders().get("Import-Package").contains("jakarta.inject"));
}
@Test
public void zoomCommandResolvesItsNamedParameterThroughPlatformInjection() {
AtomicReference<ZoomKind> zoom = new AtomicReference<>();
Viewer viewer = new Viewer() {
@Override public void zoom(ZoomKind kind) { zoom.set(kind); }
};
var context = EclipseContextFactory.create();
try {
context.set(EPartService.class, parts(new AtomicReference<>(part(viewer))));
context.set(ZoomHandler.PARAMTER_ID, "in");
ContextInjectionFactory.invoke(new ZoomHandler(), Execute.class, context);
assertEquals(ZoomKind.IN, zoom.get());
} finally {
context.dispose();
}
}
@Test
public void combineHandlerRoutesToActiveViewerAndHonorsDialogCancellation() {
var first = new TrackEntry(waveform(WaveformType.SIGNAL), null);
@@ -21,6 +21,8 @@ import org.eclipse.e4.core.contexts.EclipseContextFactory;
import org.eclipse.e4.ui.bindings.internal.BindingTable;
import org.eclipse.e4.ui.bindings.internal.BindingTableManager;
import org.eclipse.e4.ui.bindings.internal.ContextSet;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.MApplicationFactory;
import org.eclipse.jface.bindings.Binding;
import org.eclipse.jface.bindings.keys.KeyBinding;
import org.eclipse.jface.bindings.keys.KeySequence;
@@ -37,9 +39,12 @@ public class WaveformBindingsTest {
ContextSet.setComparator(new ContextSet.CComp(contexts));
var context = EclipseContextFactory.create();
try {
var application = MApplicationFactory.INSTANCE.createApplication();
application.setContext(context);
context.set(MApplication.class, application);
var manager = ContextInjectionFactory.make(BindingTableManager.class, context);
var windowTable = new BindingTable(window);
var waveformTable = new BindingTable(waveform);
var windowTable = new BindingTable(window, application);
var waveformTable = new BindingTable(waveform, application);
manager.addTable(windowTable); manager.addTable(waveformTable);
var commands = new CommandManager();
var category = commands.getCategory("test"); category.define("test", "");