Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Move long running operations to the activation of the PluginsTab" #1251

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion org.eclipse.pde.doc.user/forceQualifierUpdate.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Comparator Errors in 4.32 I-Build I20240304-0140
Update to IPDELauncherConstants
Update to IPDELauncherConstants
https://github.com/eclipse-pde/eclipse.pde/issues/1250
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ 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 @@ -157,16 +156,6 @@ 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 @@ -182,9 +171,6 @@ public void activated(ILaunchConfigurationWorkingCopy configuration) {
fDefaultAutoStart.setText(Boolean.toString(auto));
int level = configuration.getAttribute(IPDELauncherConstants.DEFAULT_START_LEVEL, 4);
fDefaultStartLevel.setSelection(level);

// If everything ran smoothly, this tab is activated
fActivated = true;
} catch (CoreException e) {
PDEPlugin.log(e);
}
Expand All @@ -202,9 +188,7 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
int index = fSelectionCombo.getSelectionIndex();
configuration.setAttribute(IPDELauncherConstants.USE_DEFAULT, index == DEFAULT_SELECTION);
configuration.setAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES, index == FEATURE_SELECTION);
if (fActivated) {
fBlock.performApply(configuration);
}
fBlock.performApply(configuration);
// clear default values for auto-start and start-level if default
String autoText = fDefaultAutoStart.getText();
if (Boolean.toString(false).equals(autoText)) {
Expand Down Expand Up @@ -233,9 +217,16 @@ 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() {
setErrorMessage(null);
String errorMessage = null;
setErrorMessage(errorMessage);
}

@Override
Expand Down
Loading