From aede775af6085d6aa4d07bb637d3848918a41a60 Mon Sep 17 00:00:00 2001 From: fedejeanne Date: Mon, 15 Apr 2024 16:23:54 +0200 Subject: [PATCH] Move long running operations to the activation of the PluginsTab - Inline value and delete outdated JavaDoc Contributes to https://github.com/eclipse-pde/eclipse.pde/issues/1232 Co-authored-by: Hannes Wellmann --- org.eclipse.pde.doc.user/META-INF/MANIFEST.MF | 2 +- org.eclipse.pde.doc.user/pom.xml | 2 +- .../eclipse/pde/ui/launcher/PluginsTab.java | 22 ++++++++++++------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/org.eclipse.pde.doc.user/META-INF/MANIFEST.MF b/org.eclipse.pde.doc.user/META-INF/MANIFEST.MF index 9d3e13632de..f10e6c89d8a 100644 --- a/org.eclipse.pde.doc.user/META-INF/MANIFEST.MF +++ b/org.eclipse.pde.doc.user/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.pde.doc.user; singleton:=true -Bundle-Version: 3.15.100.qualifier +Bundle-Version: 3.15.200.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Require-Bundle: org.eclipse.help;bundle-version="[3.2.0,4.0.0)" diff --git a/org.eclipse.pde.doc.user/pom.xml b/org.eclipse.pde.doc.user/pom.xml index fe4faf0ef18..4246ed839fd 100644 --- a/org.eclipse.pde.doc.user/pom.xml +++ b/org.eclipse.pde.doc.user/pom.xml @@ -17,7 +17,7 @@ 4.32.0-SNAPSHOT org.eclipse.pde.doc.user - 3.15.100-SNAPSHOT + 3.15.200-SNAPSHOT eclipse-plugin diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java index ec5192f5643..6c4c19f4cb4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java @@ -59,6 +59,7 @@ public class PluginsTab extends AbstractLauncherTab { private Combo fDefaultAutoStart; private Spinner fDefaultStartLevel; private final Listener fListener; + private boolean fActivated; private static final int DEFAULT_SELECTION = 0; private static final int PLUGIN_SELECTION = 1; @@ -156,6 +157,16 @@ public void createControl(Composite parent) { @Override public void initializeFrom(ILaunchConfiguration configuration) { + // Long-running initialization happens on first activation of this tab + } + + @Override + public void activated(ILaunchConfigurationWorkingCopy configuration) { + if (fActivated) { + // Since this method can be expensive, only activate this tab once. + return; + } + try { int index = DEFAULT_SELECTION; if (configuration.getAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES, false)) { @@ -174,6 +185,8 @@ public void initializeFrom(ILaunchConfiguration configuration) { } catch (CoreException e) { PDEPlugin.log(e); } + + fActivated = true; } @Override @@ -217,16 +230,9 @@ public Image getImage() { return fImage; } - /** - * Validates the tab. If the feature option is chosen, and the workspace is not correctly set up, - * the error message is set. - * - * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#validateTab() - */ @Override public void validateTab() { - String errorMessage = null; - setErrorMessage(errorMessage); + setErrorMessage(null); } @Override