Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2010-04-24 23:15:15 +0000
committerSusan Franklin2010-04-24 23:15:15 +0000
commitc3b43b95d3f89781852098b2660b4bcc1eb40ddc (patch)
tree9d97164485fd259b52e8900f3fb71cdc13d06ee9
parent9f292a983622ff559d82bc38acd0e8207ae41d6a (diff)
downloadrt.equinox.p2-c3b43b95d3f89781852098b2660b4bcc1eb40ddc.tar.gz
rt.equinox.p2-c3b43b95d3f89781852098b2660b4bcc1eb40ddc.tar.xz
rt.equinox.p2-c3b43b95d3f89781852098b2660b4bcc1eb40ddc.zip
Bug 305478 - [ui] Entering a site in the Install Software dialog does nothingv20100424-2000
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIProvisioningListener.java50
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java7
2 files changed, 34 insertions, 23 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIProvisioningListener.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIProvisioningListener.java
index b6ea74112..05972f6db 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIProvisioningListener.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIProvisioningListener.java
@@ -46,14 +46,14 @@ public abstract class ProvUIProvisioningListener implements SynchronousProvision
if (Tracing.DEBUG_EVENTS_CLIENT)
Tracing.debug("Batch Eventing: Ignore Following Events. " + getReceiverString()); //$NON-NLS-1$
} else if (o instanceof RepositoryOperationEndingEvent) {
+ RepositoryOperationEndingEvent event = (RepositoryOperationEndingEvent) o;
+
if (Tracing.DEBUG_EVENTS_CLIENT)
Tracing.debug("Batch Eventing: Batch Ended. " + getReceiverString()); //$NON-NLS-1$
-
// A batch operation completed. Refresh.
if (ProvisioningUI.getDefaultUI().getOperationRunner().eventBatchCount <= 0) {
if (Tracing.DEBUG_EVENTS_CLIENT)
Tracing.debug("Batch Eventing Complete." + getReceiverString()); //$NON-NLS-1$
- RepositoryOperationEndingEvent event = (RepositoryOperationEndingEvent) o;
if (event.getEvent() == null && event.update()) {
if (Tracing.DEBUG_EVENTS_CLIENT) {
Tracing.debug("Refreshing After Batch." + getReceiverString()); //$NON-NLS-1$
@@ -66,11 +66,22 @@ public abstract class ProvUIProvisioningListener implements SynchronousProvision
} else if (Tracing.DEBUG_EVENTS_CLIENT) {
Tracing.debug("No Refresh on Batch Complete."); //$NON-NLS-1$
}
+ } else {
+ // We are still in the middle of a batch operation, but we've been notified
+ // about a nested batch that ended. See if it ended with a specific event.
+ // If it did, this means there was a user action involving a repository
+ // (rather than side-effect events). For example, the user might add a repo while a full
+ // background load is running. We want to honor that
+ // event. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=305478
+ RepositoryEvent innerEvent = event.getEvent();
+ if (innerEvent != null) {
+ handleRepositoryEvent(innerEvent);
+ }
}
} else if (ProvisioningUI.getDefaultUI().getOperationRunner().eventBatchCount > 0) {
+ // ignore raw events during a batch
if (Tracing.DEBUG_EVENTS_CLIENT)
Tracing.debug(name + " Ignoring: " + o.toString()); //$NON-NLS-1$
- // We are in the middle of a batch operation
return;
} else if (o instanceof IProfileEvent && (((eventTypes & PROV_EVENT_IU) == PROV_EVENT_IU) || ((eventTypes & PROV_EVENT_PROFILE) == PROV_EVENT_PROFILE))) {
if (Tracing.DEBUG_EVENTS_CLIENT)
@@ -86,21 +97,7 @@ public abstract class ProvUIProvisioningListener implements SynchronousProvision
} else if (o instanceof RepositoryEvent) {
if (Tracing.DEBUG_EVENTS_CLIENT)
Tracing.debug(o.toString() + getReceiverString());
- RepositoryEvent event = (RepositoryEvent) o;
- // Do not handle unless this is the type of repo that we are interested in
- if ((event.getRepositoryType() == IRepository.TYPE_METADATA && (eventTypes & PROV_EVENT_METADATA_REPOSITORY) == PROV_EVENT_METADATA_REPOSITORY) || (event.getRepositoryType() == IRepository.TYPE_ARTIFACT && (eventTypes & PROV_EVENT_ARTIFACT_REPOSITORY) == PROV_EVENT_ARTIFACT_REPOSITORY)) {
- if (event.getKind() == RepositoryEvent.ADDED && event.isRepositoryEnabled()) {
- repositoryAdded(event);
- } else if (event.getKind() == RepositoryEvent.REMOVED && event.isRepositoryEnabled()) {
- repositoryRemoved(event);
- } else if (event.getKind() == RepositoryEvent.DISCOVERED) {
- repositoryDiscovered(event);
- } else if (event.getKind() == RepositoryEvent.CHANGED) {
- repositoryChanged(event);
- } else if (event.getKind() == RepositoryEvent.ENABLEMENT) {
- repositoryEnablement(event);
- }
- }
+ handleRepositoryEvent((RepositoryEvent) o);
}
}
@@ -108,6 +105,23 @@ public abstract class ProvUIProvisioningListener implements SynchronousProvision
return " -- <" + name + "> "; //$NON-NLS-1$//$NON-NLS-2$
}
+ private void handleRepositoryEvent(RepositoryEvent event) {
+ // Do not handle unless this is the type of repo that we are interested in
+ if ((event.getRepositoryType() == IRepository.TYPE_METADATA && (eventTypes & PROV_EVENT_METADATA_REPOSITORY) == PROV_EVENT_METADATA_REPOSITORY) || (event.getRepositoryType() == IRepository.TYPE_ARTIFACT && (eventTypes & PROV_EVENT_ARTIFACT_REPOSITORY) == PROV_EVENT_ARTIFACT_REPOSITORY)) {
+ if (event.getKind() == RepositoryEvent.ADDED && event.isRepositoryEnabled()) {
+ repositoryAdded(event);
+ } else if (event.getKind() == RepositoryEvent.REMOVED && event.isRepositoryEnabled()) {
+ repositoryRemoved(event);
+ } else if (event.getKind() == RepositoryEvent.DISCOVERED) {
+ repositoryDiscovered(event);
+ } else if (event.getKind() == RepositoryEvent.CHANGED) {
+ repositoryChanged(event);
+ } else if (event.getKind() == RepositoryEvent.ENABLEMENT) {
+ repositoryEnablement(event);
+ }
+ }
+ }
+
/**
* A repository has been added. Subclasses may override. May be called
* from a non-UI thread.
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
index 423fbb18c..d918a6993 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/ProvisioningUI.java
@@ -397,11 +397,8 @@ public class ProvisioningUI {
} catch (ProvisionException e) {
getRepositoryTracker().reportLoadFailure(location, e);
} finally {
- // We have no idea how many repos may have been touched as a result of loading this one,
- // so in theory we would not use a specific repository event to represent it.
- // In practice this can cause problems in the UI like losing selections in the repo combo.
- // So we signal an add event.
- signalRepositoryOperationComplete(new RepositoryEvent(location, IRepository.TYPE_METADATA, RepositoryEvent.ADDED, true), notify);
+ // We have no idea how many repos may have been touched as a result of loading this one.
+ signalRepositoryOperationComplete(null, notify);
}
return repo;
}

Back to the top