diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/RepositoryTrackerComponent.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/RepositoryTrackerComponent.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/RepositoryTrackerComponent.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/RepositoryTrackerComponent.java new file mode 100644 index 000000000..fa416c2d4 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/RepositoryTrackerComponent.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2011 EclipseSource Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.internal.p2.ui; + +import org.eclipse.equinox.p2.core.IProvisioningAgent; +import org.eclipse.equinox.p2.core.spi.IAgentServiceFactory; +import org.eclipse.equinox.p2.operations.RepositoryTracker; +import org.eclipse.equinox.p2.ui.ProvisioningUI; + +/** + * Component that provides a factory that can create and initialize + * {@link RepositoryTracker} instances. + */ +public class RepositoryTrackerComponent implements IAgentServiceFactory { + + public Object createService(IProvisioningAgent agent) { + ProvisioningUI ui = (ProvisioningUI) agent.getService(ProvisioningUI.class.getName()); + if (ui == null) + return null; + return new ColocatedRepositoryTracker(ui); + } +} |