Skip to content

Commit

Permalink
Move long running operations to the activation of the PluginsTab
Browse files Browse the repository at this point in the history
- Inline value and delete outdated JavaDoc

Contributes to eclipse-pde#1232

Co-authored-by: Hannes Wellmann <[email protected]>
  • Loading branch information
fedejeanne and HannesWell committed Apr 17, 2024
1 parent 35d6414 commit bf51a12
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.pde.doc.user/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
2 changes: 1 addition & 1 deletion org.eclipse.pde.doc.user/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<version>4.32.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.pde.doc.user</artifactId>
<version>3.15.100-SNAPSHOT</version>
<version>3.15.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand All @@ -174,6 +185,8 @@ public void initializeFrom(ILaunchConfiguration configuration) {
} catch (CoreException e) {
PDEPlugin.log(e);
}

fActivated = true;
}

@Override
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bf51a12

Please sign in to comment.