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
Contributes to eclipse-pde#1232
  • Loading branch information
fedejeanne committed Apr 15, 2024
1 parent 860100e commit 9d4f738
Showing 1 changed file with 13 additions and 0 deletions.
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 operations happen during the first activation of the 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

0 comments on commit 9d4f738

Please sign in to comment.