From e05f451889f599b2affed79d8432f93705912dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Tue, 8 Sep 2026 08:42:36 +0300 Subject: [PATCH] Implement FeatureCheck as DS Gets rid of the last IStartup in the installer. --- .../META-INF/MANIFEST.MF | 3 +- ....openchrom.installer.ui.FeatureCheckDS.xml | 8 ++++ .../net.openchrom.installer.ui/plugin.xml | 5 --- .../openchrom/installer/ui/FeatureCheck.java | 12 +++--- .../installer/ui/FeatureCheckDS.java | 39 +++++++++++++++++++ 5 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 openchrom/plugins/net.openchrom.installer.ui/OSGI-INF/net.openchrom.installer.ui.FeatureCheckDS.xml create mode 100644 openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/FeatureCheckDS.java diff --git a/openchrom/plugins/net.openchrom.installer.ui/META-INF/MANIFEST.MF b/openchrom/plugins/net.openchrom.installer.ui/META-INF/MANIFEST.MF index e7f2595a9..ea0176314 100644 --- a/openchrom/plugins/net.openchrom.installer.ui/META-INF/MANIFEST.MF +++ b/openchrom/plugins/net.openchrom.installer.ui/META-INF/MANIFEST.MF @@ -42,5 +42,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-25 Bundle-ActivationPolicy: lazy Automatic-Module-Name: net.openchrom.installer.ui Service-Component: OSGI-INF/net.openchrom.installer.ui.OpenchromP2Policy.xml, - OSGI-INF/net.openchrom.installer.ui.P2CleanupDS.xml + OSGI-INF/net.openchrom.installer.ui.P2CleanupDS.xml, + OSGI-INF/net.openchrom.installer.ui.FeatureCheckDS.xml Import-Package: org.osgi.service.event;version="[1.0.0,2.0.0)" diff --git a/openchrom/plugins/net.openchrom.installer.ui/OSGI-INF/net.openchrom.installer.ui.FeatureCheckDS.xml b/openchrom/plugins/net.openchrom.installer.ui/OSGI-INF/net.openchrom.installer.ui.FeatureCheckDS.xml new file mode 100644 index 000000000..1ed547479 --- /dev/null +++ b/openchrom/plugins/net.openchrom.installer.ui/OSGI-INF/net.openchrom.installer.ui.FeatureCheckDS.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/openchrom/plugins/net.openchrom.installer.ui/plugin.xml b/openchrom/plugins/net.openchrom.installer.ui/plugin.xml index 53f58821f..33771c9ee 100644 --- a/openchrom/plugins/net.openchrom.installer.ui/plugin.xml +++ b/openchrom/plugins/net.openchrom.installer.ui/plugin.xml @@ -1,10 +1,5 @@ - - - diff --git a/openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/FeatureCheck.java b/openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/FeatureCheck.java index 8cd372c25..e254f5ed7 100644 --- a/openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/FeatureCheck.java +++ b/openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/FeatureCheck.java @@ -27,7 +27,6 @@ import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialogWithToggle; import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.IStartup; import org.osgi.framework.Bundle; import net.openchrom.installer.model.IPluginDescriptor; @@ -39,12 +38,15 @@ import net.openchrom.installer.ui.discovery.PrepareInstallProfileJob; import net.openchrom.installer.ui.wizards.PluginDiscoveryWizard; -public class FeatureCheck implements IStartup { +public class FeatureCheck { private static final Logger logger = Logger.getLogger(FeatureCheck.class); - @Override - public void earlyStartup() { + private FeatureCheck() { + + } + + public static void check() { for(String feature : getConverterFeatures()) { Bundle bundle = Platform.getBundle(feature); @@ -87,7 +89,7 @@ public void earlyStartup() { } } - private List getConverterFeatures() { + private static List getConverterFeatures() { List features = new ArrayList<>(); PluginDiscoveryExtensionReader extensionReader = new PluginDiscoveryExtensionReader(); diff --git a/openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/FeatureCheckDS.java b/openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/FeatureCheckDS.java new file mode 100644 index 000000000..8bed367f4 --- /dev/null +++ b/openchrom/plugins/net.openchrom.installer.ui/src/net/openchrom/installer/ui/FeatureCheckDS.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2026 Lablicate GmbH. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Aleksandar Kurtakov - initial API and implementation + *******************************************************************************/ +package net.openchrom.installer.ui; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.e4.ui.workbench.UIEvents; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.event.Event; +import org.osgi.service.event.EventHandler; +import org.osgi.service.event.propertytypes.EventTopics; + +@Component(service = EventHandler.class) +@EventTopics(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) +public class FeatureCheckDS implements EventHandler { + + @Override + public void handleEvent(Event event) { + + Job job = Job.create("Check for vendor converter plug-ins", (IProgressMonitor _) -> { + + FeatureCheck.check(); + return Status.OK_STATUS; + }); + job.setSystem(true); + job.schedule(); + } +}