Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2010-01-13 12:29:41 -0500
committerPascal Rapicault2010-01-13 12:29:41 -0500
commit18189f0d42f7375660762dc6c885cf31683ae562 (patch)
tree17775d847bed9a33f3c68b74db2df75a2139c0bc /bundles/org.eclipse.equinox.p2.ui.admin
parentc363f2984a09b73c422e38f4556fd3b23eafe958 (diff)
downloadrt.equinox.p2-18189f0d42f7375660762dc6c885cf31683ae562.tar.gz
rt.equinox.p2-18189f0d42f7375660762dc6c885cf31683ae562.tar.xz
rt.equinox.p2-18189f0d42f7375660762dc6c885cf31683ae562.zip
Merging api branch back to HEADv20100113
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.admin')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.classpath4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.settings/org.eclipse.jdt.core.prefs16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF32
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/build.properties5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java44
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java83
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java72
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java84
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java80
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java83
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java100
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIMessages.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RefreshArtifactRepositoriesOperation.java50
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RefreshMetadataRepositoriesOperation.java52
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveArtifactRepositoryOperation.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveMetadataRepositoryOperation.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java37
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java62
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java109
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java23
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddProfileDialog.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUGroup.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationGroup.java37
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationPropertyPage.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUPropertiesGroup.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/InstalledIUPropertyPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfilePropertyPage.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/messages.properties9
36 files changed, 646 insertions, 705 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/.classpath b/bundles/org.eclipse.equinox.p2.ui.admin/.classpath
index ce7393340..64c5e31b7 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/.classpath
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.ui.admin/.settings/org.eclipse.jdt.core.prefs
index 78523cd05..eba723b85 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Aug 16 11:00:59 EDT 2007
+#Tue Dec 22 23:48:18 CET 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,24 +7,24 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=jsr14
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
@@ -62,7 +62,6 @@ org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedImport=error
@@ -72,7 +71,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -144,7 +143,6 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF
index 3f8bf2210..618b5065e 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF
@@ -6,32 +6,36 @@ Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.equinox.p2.ui.admin;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIActivator
-Bundle-RequiredExecutionEnvironment: J2SE-1.4,
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
CDC-1.1/Foundation-1.1
Import-Package: org.eclipse.equinox.internal.p2.core.helpers,
+ org.eclipse.equinox.internal.p2.ui,
+ org.eclipse.equinox.internal.p2.ui.actions,
+ org.eclipse.equinox.internal.p2.ui.dialogs,
org.eclipse.equinox.internal.p2.ui.model,
org.eclipse.equinox.internal.p2.ui.query,
- org.eclipse.equinox.internal.provisional.p2.artifact.repository,
+ org.eclipse.equinox.internal.p2.ui.viewers,
org.eclipse.equinox.internal.provisional.p2.core,
org.eclipse.equinox.internal.provisional.p2.core.eventbus,
- org.eclipse.equinox.internal.provisional.p2.repository,
org.eclipse.equinox.internal.provisional.p2.director,
- org.eclipse.equinox.internal.provisional.p2.engine,
org.eclipse.equinox.internal.provisional.p2.metadata,
- org.eclipse.equinox.internal.provisional.p2.metadata.query,
- org.eclipse.equinox.internal.provisional.p2.metadata.repository,
- org.eclipse.equinox.internal.provisional.p2.ui,
- org.eclipse.equinox.internal.provisional.p2.ui.actions,
- org.eclipse.equinox.internal.provisional.p2.ui.dialogs,
- org.eclipse.equinox.internal.provisional.p2.ui.model,
- org.eclipse.equinox.internal.provisional.p2.ui.operations,
- org.eclipse.equinox.internal.provisional.p2.ui.policy,
- org.eclipse.equinox.internal.provisional.p2.ui.viewers,
+ org.eclipse.equinox.internal.provisional.p2.repository,
org.eclipse.equinox.internal.provisional.p2.updatechecker,
+ org.eclipse.equinox.p2.core,
+ org.eclipse.equinox.p2.engine,
+ org.eclipse.equinox.p2.engine.query,
+ org.eclipse.equinox.p2.metadata,
+ org.eclipse.equinox.p2.metadata.query,
+ org.eclipse.equinox.p2.operations,
+ org.eclipse.equinox.p2.repository,
+ org.eclipse.equinox.p2.repository.artifact,
+ org.eclipse.equinox.p2.repository.metadata,
+ org.eclipse.equinox.p2.ui,
org.eclipse.osgi.service.environment;version="1.0.0",
org.eclipse.osgi.util;version="1.1.0",
org.osgi.framework;version="1.3.0"
-Export-Package: org.eclipse.equinox.internal.p2.ui.admin;x-internal:=true,
+Export-Package: org.eclipse.equinox.internal.p2.ui.admin;x-friends:="org.eclipse.equinox.internal.p2.ui.analysis",
org.eclipse.equinox.internal.p2.ui.admin.dialogs;x-internal:=true,
org.eclipse.equinox.internal.p2.ui.admin.preferences;x-internal:=true
Require-Bundle: org.eclipse.core.runtime,
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/build.properties b/bundles/org.eclipse.equinox.p2.ui.admin/build.properties
index 35011865d..b7d66df9b 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/build.properties
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/build.properties
@@ -16,6 +16,5 @@ bin.includes = plugin.properties,\
META-INF/
src.includes = about.html
source.. = src/
-
-
-
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml b/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml
index d866395a7..6aa850827 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml
@@ -66,7 +66,7 @@
class="org.eclipse.equinox.internal.p2.ui.admin.dialogs.ProfilePropertyPage"
id="org.eclipse.equinox.internal.p2.ui.admin.dialogs.ProfilePropertyPage">
<enabledWhen>
- <adapt type="org.eclipse.equinox.internal.provisional.p2.engine.IProfile"/>
+ <adapt type="org.eclipse.equinox.p2.engine.IProfile"/>
</enabledWhen>
</page>
<page
@@ -74,7 +74,7 @@
class="org.eclipse.equinox.internal.p2.ui.admin.dialogs.IUImplementationPropertyPage"
id="org.eclipse.equinox.internal.p2.ui.admin.dialogs.IUImplementationPropertyPage">
<enabledWhen>
- <adapt type="org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit"/>
+ <adapt type="org.eclipse.equinox.p2.metadata.IInstallableUnit"/>
</enabledWhen>
</page>
<page
@@ -83,7 +83,7 @@
id="org.eclipse.equinox.internal.p2.ui.admin.dialogs.InstalledIUPropertyPage">
<enabledWhen>
<instanceof
- value="org.eclipse.equinox.internal.provisional.p2.ui.model.InstalledIUElement">
+ value="org.eclipse.equinox.internal.p2.ui.model.InstalledIUElement">
</instanceof>
</enabledWhen>
</page>
@@ -92,7 +92,7 @@
class="org.eclipse.equinox.internal.p2.ui.admin.dialogs.RepositoryImplementationPropertyPage"
id="org.eclipse.equinox.internal.p2.ui.admin.dialogs.RepositoryImplementationPropertyPage">
<enabledWhen>
- <adapt type="org.eclipse.equinox.internal.provisional.p2.repository.IRepository"/>
+ <adapt type="org.eclipse.equinox.p2.repository.IRepository"/>
</enabledWhen>
</page>
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java
deleted file mode 100644
index 7882bf660..000000000
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.ui.admin;
-
-import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
-
-import java.net.URI;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.AddRepositoryOperation;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
-
-/**
- * Operation which adds an artifact repository given its URI.
- *
- * @since 3.4
- */
-public class AddArtifactRepositoryOperation extends AddRepositoryOperation {
-
- public AddArtifactRepositoryOperation(String label, URI location) {
- super(label, new URI[] {location});
- }
-
- protected IStatus doBatchedExecute(IProgressMonitor monitor) throws ProvisionException {
- SubMonitor mon = SubMonitor.convert(monitor, locations.length);
- for (int i = 0; i < locations.length; i++) {
- ProvisioningUtil.addArtifactRepository(locations[i], notify);
- mon.worked(1);
- }
- return okStatus();
- }
-
- protected void setNickname(URI location, String nickname) throws ProvisionException {
- for (int i = 0; i < locations.length; i++) {
- ProvisioningUtil.setArtifactRepositoryProperty(location, IRepository.PROP_NICKNAME, nickname);
- }
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java
deleted file mode 100644
index 4d1baa1b2..000000000
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.ui.admin;
-
-import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
-
-import java.net.URI;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.AddRepositoryOperation;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
-
-/**
- * Operation that adds a metadata repository given its URL.
- *
- * @since 3.4
- */
-public class AddMetadataRepositoryOperation extends AddRepositoryOperation {
-
- public AddMetadataRepositoryOperation(String label, URI location) {
- super(label, new URI[] {location});
- }
-
- protected IStatus doBatchedExecute(IProgressMonitor monitor) throws ProvisionException {
- SubMonitor mon = SubMonitor.convert(monitor, locations.length);
- for (int i = 0; i < locations.length; i++) {
- ProvisioningUtil.addMetadataRepository(locations[i], notify);
- mon.worked(1);
- }
- return okStatus();
- }
-
- protected void setNickname(URI location, String nickname) throws ProvisionException {
- for (int i = 0; i < locations.length; i++) {
- ProvisioningUtil.setMetadataRepositoryProperty(location, IRepository.PROP_NICKNAME, nickname);
- }
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java
new file mode 100644
index 000000000..4a3efe470
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ui.admin;
+
+import org.eclipse.equinox.p2.core.ProvisionException;
+
+import java.util.Map;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.p2.operations.ProvisioningJob;
+import org.eclipse.equinox.p2.operations.ProvisioningSession;
+
+/**
+ * Operation that adds the given profile to the profile registry.
+ *
+ * @since 3.6
+ */
+public class AddProfileJob extends ProvisioningJob {
+ private String profileId;
+ private Map<String, String> profileProperties;
+
+ public AddProfileJob(String label, ProvisioningSession session, String profileId, Map<String, String> profileProperties) {
+ super(label, session);
+ this.profileId = profileId;
+ this.profileProperties = profileProperties;
+ }
+
+ public IStatus runModal(IProgressMonitor monitor) {
+ IStatus status = Status.OK_STATUS;
+ try {
+ getSession().getProfileRegistry().addProfile(profileId, profileProperties);
+ } catch (ProvisionException e) {
+ status = getErrorStatus(null, e);
+ }
+ return status;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
index 376bad13a..a2bdc4e7b 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
@@ -10,16 +10,12 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin;
-import java.net.URI;
-import java.util.ArrayList;
+import org.eclipse.equinox.internal.p2.ui.ProvUIProvisioningListener;
+import org.eclipse.equinox.internal.p2.ui.QueryableArtifactRepositoryManager;
import org.eclipse.equinox.internal.p2.ui.admin.dialogs.AddArtifactRepositoryDialog;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvisioningOperationRunner;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.ArtifactRepositories;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.RemoveRepositoryOperation;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.StructuredViewerProvisioningListener;
+import org.eclipse.equinox.internal.p2.ui.model.ArtifactRepositories;
+import org.eclipse.equinox.p2.operations.RepositoryTracker;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.statushandlers.StatusManager;
/**
* This view allows users to interact with artifact repositories
@@ -28,6 +24,8 @@ import org.eclipse.ui.statushandlers.StatusManager;
*/
public class ArtifactRepositoriesView extends RepositoriesView {
+ private RepositoryTracker tracker;
+
/**
*
*/
@@ -36,7 +34,7 @@ public class ArtifactRepositoriesView extends RepositoriesView {
}
protected Object getInput() {
- return new ArtifactRepositories(ProvAdminUIActivator.getDefault().getPolicy());
+ return new ArtifactRepositories(getProvisioningUI(), new QueryableArtifactRepositoryManager(getProvisioningUI(), false));
}
protected String getAddCommandLabel() {
@@ -52,16 +50,7 @@ public class ArtifactRepositoriesView extends RepositoriesView {
}
protected int openAddRepositoryDialog(Shell shell) {
- return new AddArtifactRepositoryDialog(shell, ProvAdminUIActivator.getDefault().getPolicy()).open();
- }
-
- protected RemoveRepositoryOperation getRemoveOperation(Object[] elements) {
- ArrayList locations = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IRepositoryElement)
- locations.add(((IRepositoryElement) elements[i]).getLocation());
- }
- return new RemoveArtifactRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, (URI[]) locations.toArray(new URI[locations.size()]));
+ return new AddArtifactRepositoryDialog(shell, getProvisioningUI()).open();
}
/*
@@ -69,15 +58,16 @@ public class ArtifactRepositoriesView extends RepositoriesView {
* @see org.eclipse.equinox.internal.p2.ui.admin.RepositoriesView#getListenerEventTypes()
*/
protected int getListenerEventTypes() {
- return StructuredViewerProvisioningListener.PROV_EVENT_ARTIFACT_REPOSITORY;
+ return ProvUIProvisioningListener.PROV_EVENT_ARTIFACT_REPOSITORY;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.equinox.internal.p2.ui.admin.ProvView#refreshUnderlyingModel()
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.internal.p2.ui.admin.RepositoriesView#getRepositoryTracker()
*/
- protected void refreshUnderlyingModel() {
- ProvisioningOperationRunner.schedule(new RefreshArtifactRepositoriesOperation(ProvAdminUIMessages.ProvView_RefreshCommandLabel, ProvAdminUIActivator.getDefault().getPolicy().getQueryContext().getArtifactRepositoryFlags()), StatusManager.SHOW | StatusManager.LOG);
+ protected RepositoryTracker getRepositoryTracker() {
+ if (tracker == null)
+ tracker = new ArtifactRepositoryTracker(getProvisioningUI());
+ return tracker;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java
new file mode 100644
index 000000000..b4fbdba2d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoryTracker.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.ui.admin;
+
+import org.eclipse.equinox.p2.core.ProvisionException;
+
+import java.net.URI;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
+import org.eclipse.equinox.p2.operations.ProvisioningSession;
+import org.eclipse.equinox.p2.operations.RepositoryTracker;
+import org.eclipse.equinox.p2.repository.IRepository;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
+
+public class ArtifactRepositoryTracker extends RepositoryTracker {
+
+ ProvisioningUI ui;
+
+ public ArtifactRepositoryTracker(ProvisioningUI ui) {
+ this.ui = ui;
+ }
+
+ public URI[] getKnownRepositories(ProvisioningSession session) {
+ return session.getArtifactRepositoryManager().getKnownRepositories(getArtifactRepositoryFlags());
+ }
+
+ protected IStatus validateRepositoryLocationWithManager(ProvisioningSession session, URI location, IProgressMonitor monitor) {
+ return Status.OK_STATUS;
+ }
+
+ public void addRepository(URI repoLocation, String nickname, ProvisioningSession session) {
+ ui.signalRepositoryOperationStart();
+ try {
+ session.getArtifactRepositoryManager().addRepository(repoLocation);
+ if (nickname != null)
+ session.getArtifactRepositoryManager().setRepositoryProperty(repoLocation, IRepository.PROP_NICKNAME, nickname);
+ } finally {
+ ui.signalRepositoryOperationComplete(new RepositoryEvent(repoLocation, IRepository.TYPE_ARTIFACT, RepositoryEvent.ADDED, true), true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.p2.operations.RepositoryTracker#removeRepositories(java.net.URI[], org.eclipse.equinox.p2.operations.ProvisioningSession)
+ */
+ public void removeRepositories(URI[] repoLocations, ProvisioningSession session) {
+ ui.signalRepositoryOperationStart();
+ try {
+ for (int i = 0; i < repoLocations.length; i++) {
+ session.getArtifactRepositoryManager().removeRepository(repoLocations[i]);
+ }
+ } finally {
+ ui.signalRepositoryOperationComplete(null, true);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.equinox.p2.operations.RepositoryTracker#refreshRepositories(java.net.URI[], org.eclipse.equinox.p2.operations.ProvisioningSession, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void refreshRepositories(URI[] locations, ProvisioningSession session, IProgressMonitor monitor) {
+ ui.signalRepositoryOperationStart();
+ SubMonitor mon = SubMonitor.convert(monitor, locations.length * 100);
+ for (int i = 0; i < locations.length; i++) {
+ try {
+ session.getArtifactRepositoryManager().refreshRepository(locations[i], mon.newChild(100));
+ } catch (ProvisionException e) {
+ //ignore problematic repositories when refreshing
+ }
+ }
+ // We have no idea how many repos may have been added/removed as a result of
+ // refreshing these, this one, so we do not use a specific repository event to represent it.
+ ui.signalRepositoryOperationComplete(null, true);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
index 172726c5e..df1c314c1 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
@@ -11,27 +11,24 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin;
-import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager;
-
-import java.net.URI;
-import java.util.ArrayList;
import java.util.List;
+import org.eclipse.equinox.internal.p2.ui.ProvUIProvisioningListener;
+import org.eclipse.equinox.internal.p2.ui.QueryableMetadataRepositoryManager;
+import org.eclipse.equinox.internal.p2.ui.actions.InstallAction;
import org.eclipse.equinox.internal.p2.ui.admin.dialogs.AddMetadataRepositoryDialog;
import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvisioningOperationRunner;
-import org.eclipse.equinox.internal.provisional.p2.ui.actions.InstallAction;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.MetadataRepositories;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.RemoveRepositoryOperation;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.IUDragAdapter;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.StructuredViewerProvisioningListener;
+import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositories;
+import org.eclipse.equinox.internal.p2.ui.query.IUViewQueryContext;
+import org.eclipse.equinox.internal.p2.ui.viewers.IUDragAdapter;
+import org.eclipse.equinox.p2.operations.RepositoryTracker;
+import org.eclipse.equinox.p2.repository.IRepositoryManager;
+import org.eclipse.equinox.p2.ui.Policy;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.dnd.*;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.part.PluginTransfer;
-import org.eclipse.ui.statushandlers.StatusManager;
/**
* This view allows users to interact with metadata repositories
@@ -41,6 +38,8 @@ import org.eclipse.ui.statushandlers.StatusManager;
public class MetadataRepositoriesView extends RepositoriesView {
private InstallAction installAction;
+ private RepositoryTracker tracker;
+ MetadataRepositories input;
/**
* The constructor.
@@ -50,7 +49,18 @@ public class MetadataRepositoriesView extends RepositoriesView {
}
protected Object getInput() {
- return new MetadataRepositories(ProvAdminUIActivator.getDefault().getPolicy());
+ if (input == null) {
+ // view by repo
+ IUViewQueryContext context = new IUViewQueryContext(IUViewQueryContext.AVAILABLE_VIEW_BY_REPO);
+ Policy policy = ProvAdminUIActivator.getDefault().getPolicy();
+ context.setShowLatestVersionsOnly(policy.getShowLatestVersionsOnly());
+ context.setShowInstallChildren(policy.getShowDrilldownRequirements());
+ context.setShowProvisioningPlanChildren(policy.getShowDrilldownRequirements());
+ context.setUseCategories(policy.getGroupByCategory());
+
+ input = new MetadataRepositories(context, getProvisioningUI(), new QueryableMetadataRepositoryManager(getProvisioningUI(), false));
+ }
+ return input;
}
protected String getAddCommandLabel() {
@@ -66,21 +76,12 @@ public class MetadataRepositoriesView extends RepositoriesView {
}
protected int openAddRepositoryDialog(Shell shell) {
- return new AddMetadataRepositoryDialog(shell, ProvAdminUIActivator.getDefault().getPolicy()).open();
- }
-
- protected RemoveRepositoryOperation getRemoveOperation(Object[] elements) {
- ArrayList locations = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IRepositoryElement)
- locations.add(((IRepositoryElement) elements[i]).getLocation());
- }
- return new RemoveMetadataRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, (URI[]) locations.toArray(new URI[locations.size()]));
+ return new AddMetadataRepositoryDialog(shell, getProvisioningUI()).open();
}
protected void makeActions() {
super.makeActions();
- installAction = new InstallAction(ProvAdminUIActivator.getDefault().getPolicy(), viewer, null);
+ installAction = new InstallAction(getProvisioningUI(), viewer, null);
}
protected void fillContextMenu(IMenuManager manager) {
@@ -109,21 +110,22 @@ public class MetadataRepositoriesView extends RepositoriesView {
* @see org.eclipse.equinox.internal.p2.ui.admin.RepositoriesView#getListenerEventTypes()
*/
protected int getListenerEventTypes() {
- return StructuredViewerProvisioningListener.PROV_EVENT_METADATA_REPOSITORY;
+ return ProvUIProvisioningListener.PROV_EVENT_METADATA_REPOSITORY;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.equinox.internal.p2.ui.admin.ProvView#refreshUnderlyingModel()
- */
- protected void refreshUnderlyingModel() {
- ProvisioningOperationRunner.schedule(new RefreshMetadataRepositoriesOperation(ProvAdminUIMessages.ProvView_RefreshCommandLabel, getRepoFlags()), StatusManager.SHOW | StatusManager.LOG);
- }
-
- protected List getVisualProperties() {
- List list = super.getVisualProperties();
+ protected List<String> getVisualProperties() {
+ List<String> list = super.getVisualProperties();
list.add(PreferenceConstants.PREF_USE_CATEGORIES);
list.add(PreferenceConstants.PREF_COLLAPSE_IU_VERSIONS);
return list;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.internal.p2.ui.admin.RepositoriesView#getRepositoryTracker()
+ */
+ protected RepositoryTracker getRepositoryTracker() {
+ if (tracker == null)
+ tracker = new MetadataRepositoryTracker(getProvisioningUI());
+ return tracker;
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java
new file mode 100644
index 000000000..52c260adb
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoryTracker.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.ui.admin;
+
+import org.eclipse.equinox.p2.core.ProvisionException;
+
+import java.net.URI;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
+import org.eclipse.equinox.p2.operations.ProvisioningSession;
+import org.eclipse.equinox.p2.operations.RepositoryTracker;
+import org.eclipse.equinox.p2.repository.IRepository;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
+
+public class MetadataRepositoryTracker extends RepositoryTracker {
+
+ ProvisioningUI ui;
+
+ public MetadataRepositoryTracker(ProvisioningUI ui) {
+ this.ui = ui;
+ }
+
+ public URI[] getKnownRepositories(ProvisioningSession session) {
+ return session.getMetadataRepositoryManager().getKnownRepositories(getArtifactRepositoryFlags());
+ }
+
+ protected IStatus validateRepositoryLocationWithManager(ProvisioningSession session, URI location, IProgressMonitor monitor) {
+ return Status.OK_STATUS;
+ }
+
+ public void addRepository(URI repoLocation, String nickname, ProvisioningSession session) {
+ ui.signalRepositoryOperationStart();
+ try {
+ session.getMetadataRepositoryManager().addRepository(repoLocation);
+ if (nickname != null)
+ session.getMetadataRepositoryManager().setRepositoryProperty(repoLocation, IRepository.PROP_NICKNAME, nickname);
+
+ } finally {
+ ui.signalRepositoryOperationComplete(new RepositoryEvent(repoLocation, IRepository.TYPE_METADATA, RepositoryEvent.ADDED, true), true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.p2.operations.RepositoryTracker#removeRepositories(java.net.URI[], org.eclipse.equinox.p2.operations.ProvisioningSession)
+ */
+ public void removeRepositories(URI[] repoLocations, ProvisioningSession session) {
+ ui.signalRepositoryOperationStart();
+ try {
+ for (int i = 0; i < repoLocations.length; i++) {
+ session.getMetadataRepositoryManager().removeRepository(repoLocations[i]);
+ }
+ } finally {
+ ui.signalRepositoryOperationComplete(null, true);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.equinox.p2.operations.RepositoryTracker#refreshRepositories(java.net.URI[], org.eclipse.equinox.p2.operations.ProvisioningSession, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void refreshRepositories(URI[] locations, ProvisioningSession session, IProgressMonitor monitor) {
+ ui.signalRepositoryOperationStart();
+ SubMonitor mon = SubMonitor.convert(monitor, locations.length * 100);
+ for (int i = 0; i < locations.length; i++) {
+ try {
+ session.getArtifactRepositoryManager().refreshRepository(locations[i], mon.newChild(100));
+ } catch (ProvisionException e) {
+ //ignore problematic repositories when refreshing
+ }
+ }
+ // We have no idea how many repos may have been added/removed as a result of
+ // refreshing these, this one, so we do not use a specific repository event to represent it.
+ ui.signalRepositoryOperationComplete(null, true);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java
new file mode 100644
index 000000000..cae6b67f1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ui.admin;
+
+import org.eclipse.equinox.p2.core.ProvisionException;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
+import org.eclipse.equinox.internal.p2.ui.ProvUIActivator;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.osgi.service.environment.EnvironmentInfo;
+
+/**
+ * Factory class that can create a new profile with the correct
+ * default values.
+ *
+ * @since 3.4
+ *
+ */
+public class ProfileFactory {
+
+ static private String FLAVOR_DEFAULT = "tooling"; //$NON-NLS-1$
+ static private String EMPTY = ""; //$NON-NLS-1$
+ static private EnvironmentInfo info;
+
+ public static IProfile makeProfile(String profileId) {
+ Map<String, String> profileProperties = new HashMap<String, String>();
+ profileProperties.put(IProfile.PROP_INSTALL_FOLDER, getDefaultLocation());
+ profileProperties.put(IProfile.PROP_ENVIRONMENTS, getDefaultEnvironments());
+ profileProperties.put(IProfile.PROP_NL, getDefaultNL());
+
+ try {
+ return ProvAdminUIActivator.getDefault().getProvisioningUI(null).getSession().getProfileRegistry().addProfile(profileId, profileProperties);
+ } catch (ProvisionException e) {
+ // log
+ }
+ return null;
+ }
+
+ public static String getDefaultLocation() {
+ return Platform.getUserLocation().getURL().getPath();
+ }
+
+ public static String getDefaultFlavor() {
+ return FLAVOR_DEFAULT;
+ }
+
+ private static EnvironmentInfo getEnvironmentInfo() {
+ if (info == null) {
+ info = (EnvironmentInfo) ServiceHelper.getService(ProvUIActivator.getContext(), EnvironmentInfo.class.getName());
+ }
+ return info;
+ }
+
+ public static String getDefaultNL() {
+ if (getEnvironmentInfo() != null) {
+ return info.getNL();
+ }
+ return EMPTY;
+ }
+
+ public static String getDefaultEnvironments() {
+ if (getEnvironmentInfo() != null) {
+ return "osgi.os=" //$NON-NLS-1$
+ + info.getOS() + ",osgi.ws=" + info.getWS() //$NON-NLS-1$
+ + ",osgi.arch=" + info.getOSArch(); //$NON-NLS-1$
+ }
+ return EMPTY;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
index 43cb8b357..df5cef119 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
@@ -13,28 +13,23 @@ package org.eclipse.equinox.internal.p2.ui.admin;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.equinox.internal.p2.ui.*;
+import org.eclipse.equinox.internal.p2.ui.actions.UninstallAction;
+import org.eclipse.equinox.internal.p2.ui.actions.UpdateAction;
import org.eclipse.equinox.internal.p2.ui.admin.dialogs.AddProfileDialog;
import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
-import org.eclipse.equinox.internal.provisional.p2.ui.*;
-import org.eclipse.equinox.internal.provisional.p2.ui.actions.UninstallAction;
-import org.eclipse.equinox.internal.provisional.p2.ui.actions.UpdateAction;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.*;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.RemoveProfilesOperation;
-import org.eclipse.equinox.internal.provisional.p2.ui.policy.IProfileChooser;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.*;
+import org.eclipse.equinox.internal.p2.ui.model.*;
+import org.eclipse.equinox.internal.p2.ui.viewers.*;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.action.*;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.statushandlers.StatusManager;
/**
* This view allows users to interact with installed profiles.
@@ -42,7 +37,7 @@ import org.eclipse.ui.statushandlers.StatusManager;
* @since 3.4
*/
public class ProfilesView extends ProvView {
- private Action addProfileAction, removeProfileAction, uninstallAction;
+ protected Action addProfileAction, removeProfileAction, uninstallAction;
UpdateAction updateAction;
private PropertyDialogAction propertiesAction;
private StructuredViewerProvisioningListener listener;
@@ -58,13 +53,13 @@ public class ProfilesView extends ProvView {
public void run() {
Object[] selections = getSelection().toArray();
- List profilesOnly = new ArrayList();
+ List<String> profilesOnly = new ArrayList<String>();
for (int i = 0; i < selections.length; i++) {
if (selections[i] instanceof ProfileElement)
profilesOnly.add(((ProfileElement) selections[i]).getProfileId());
}
- RemoveProfilesOperation op = new RemoveProfilesOperation(ProvAdminUIMessages.Ops_RemoveProfileOperationLabel, (String[]) profilesOnly.toArray(new String[profilesOnly.size()]));
- ProvisioningOperationRunner.run(op, StatusManager.SHOW | StatusManager.LOG);
+ RemoveProfilesJob op = new RemoveProfilesJob(ProvAdminUIMessages.Ops_RemoveProfileOperationLabel, getProvisioningUI().getSession(), profilesOnly.toArray(new String[profilesOnly.size()]));
+ ProfilesView.this.run(op);
}
}
@@ -86,7 +81,7 @@ public class ProfilesView extends ProvView {
protected void addListeners() {
super.addListeners();
- listener = new StructuredViewerProvisioningListener(viewer, StructuredViewerProvisioningListener.PROV_EVENT_IU | StructuredViewerProvisioningListener.PROV_EVENT_PROFILE);
+ listener = new StructuredViewerProvisioningListener(viewer, ProvUIProvisioningListener.PROV_EVENT_IU | ProvUIProvisioningListener.PROV_EVENT_PROFILE);
ProvUI.addProvisioningListener(listener);
}
@@ -97,7 +92,7 @@ public class ProfilesView extends ProvView {
protected void configureViewer(TreeViewer treeViewer) {
super.configureViewer(treeViewer);
- InstallIUDropAdapter adapter = new InstallIUDropAdapter(ProvAdminUIActivator.getDefault().getPolicy(), treeViewer);
+ InstallIUDropAdapter adapter = new InstallIUDropAdapter(getProvisioningUI(), treeViewer);
adapter.setFeedbackEnabled(false);
Transfer[] transfers = new Transfer[] {org.eclipse.jface.util.LocalSelectionTransfer.getTransfer()};
treeViewer.addDropSupport(DND.DROP_COPY, transfers, adapter);
@@ -137,9 +132,9 @@ public class ProfilesView extends ProvView {
super.makeActions();
addProfileAction = new AddProfileAction();
removeProfileAction = new RemoveProfileAction();
- uninstallAction = new UninstallAction(ProvAdminUIActivator.getDefault().getPolicy(), viewer, null);
+ uninstallAction = new UninstallAction(getProvisioningUI(), viewer, null);
propertiesAction = new PropertyDialogAction(this.getSite(), viewer);
- updateAction = new UpdateAction(ProvAdminUIActivator.getDefault().getPolicy(), viewer, null, true);
+ updateAction = new UpdateAction(getProvisioningUI(), viewer, null, true);
updateAction.setSkipSelectionPage(true);
getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertiesAction);
@@ -165,7 +160,7 @@ public class ProfilesView extends ProvView {
if (selectionArray.length > 0) {
removeProfileAction.setEnabled(true);
for (int i = 0; i < selectionArray.length; i++) {
- IProfile profile = (IProfile) ProvUI.getAdapter(selectionArray[i], IProfile.class);
+ IProfile profile = ProvUI.getAdapter(selectionArray[i], IProfile.class);
if (profile == null) {
removeProfileAction.setEnabled(false);
break;
@@ -183,41 +178,35 @@ public class ProfilesView extends ProvView {
}
protected Object getInput() {
- return new Profiles(ProvAdminUIActivator.getDefault().getPolicy());
+ return new Profiles(getProvisioningUI());
}
- IProfileChooser getProfileChooser() {
- return new IProfileChooser() {
- public String getProfileId(Shell shell) {
- Object firstElement = getSelection().getFirstElement();
- if (firstElement instanceof InstalledIUElement) {
- return ((InstalledIUElement) firstElement).getProfileId();
- }
- IProfile profile = (IProfile) ProvUI.getAdapter(firstElement, IProfile.class);
- if (profile != null)
- return profile.getProfileId();
- return null;
- }
- };
+ protected String getProfileId() {
+ Object firstElement = getSelection().getFirstElement();
+ if (firstElement instanceof InstalledIUElement) {
+ return ((InstalledIUElement) firstElement).getProfileId();
+ }
+ IProfile profile = ProvUI.getAdapter(firstElement, IProfile.class);
+ if (profile != null)
+ return profile.getProfileId();
+ return null;
}
- protected List getVisualProperties() {
- List list = super.getVisualProperties();
+ protected List<String> getVisualProperties() {
+ List<String> list = super.getVisualProperties();
list.add(PreferenceConstants.PREF_SHOW_INSTALL_ROOTS_ONLY);
return list;
}
String[] getKnownProfileIds() {
- try {
- IProfile[] allProfiles = ProvisioningUtil.getProfiles();
- String[] ids = new String[allProfiles.length];
- for (int i = 0; i < allProfiles.length; i++)
- ids[i] = allProfiles[i].getProfileId();
- return ids;
- } catch (ProvisionException e) {
- ProvUI.handleException(e, ProvAdminUIMessages.ProfilesView_ErrorRetrievingProfiles, StatusManager.LOG);
- return new String[0];
- }
+ IProfile[] allProfiles = getProvisioningUI().getSession().getProfileRegistry().getProfiles();
+ String[] ids = new String[allProfiles.length];
+ for (int i = 0; i < allProfiles.length; i++)
+ ids[i] = allProfiles[i].getProfileId();
+ return ids;
+ }
+ protected ProvisioningUI getProvisioningUI() {
+ return ProvAdminUIActivator.getDefault().getProvisioningUI(getProfileId());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java
index 04daad34e..b9dafea71 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java
@@ -10,26 +10,21 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin;
-import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager;
-
-import org.eclipse.equinox.internal.p2.ui.admin.dialogs.AddProfileDialog;
+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
+import org.eclipse.equinox.internal.p2.ui.ProvUIActivator;
+import org.eclipse.equinox.internal.p2.ui.ValidationDialogServiceUI;
import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants;
import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI;
-import org.eclipse.equinox.internal.provisional.p2.director.ProvisioningPlan;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
-import org.eclipse.equinox.internal.provisional.p2.ui.ValidationDialogServiceUI;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.Profiles;
-import org.eclipse.equinox.internal.provisional.p2.ui.policy.*;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.ProvElementContentProvider;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.ProvElementLabelProvider;
+import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
+import org.eclipse.equinox.p2.metadata.query.GroupQuery;
+import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.operations.RepositoryTracker;
+import org.eclipse.equinox.p2.repository.IRepositoryManager;
+import org.eclipse.equinox.p2.ui.Policy;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ListDialog;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
@@ -105,79 +100,52 @@ public class ProvAdminUIActivator extends AbstractUIPlugin {
if (preferenceListener == null) {
preferenceListener = new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
- updateForPreferences(getPolicy().getQueryContext());
+ updateForPreferences();
}
};
}
return preferenceListener;
}
- void updateForPreferences(IUViewQueryContext queryContext) {
+ void updateForPreferences() {
+
if (getPreferenceStore().getBoolean(PreferenceConstants.PREF_SHOW_GROUPS_ONLY))
- queryContext.setVisibleAvailableIUProperty(IInstallableUnit.PROP_TYPE_GROUP);
+ policy.setVisibleAvailableIUQuery(new GroupQuery());
else
- queryContext.setVisibleAvailableIUProperty(null);
+ policy.setVisibleAvailableIUQuery(InstallableUnitQuery.ANY);
if (getPreferenceStore().getBoolean(PreferenceConstants.PREF_SHOW_INSTALL_ROOTS_ONLY))
- queryContext.setVisibleInstalledIUProperty(IInstallableUnit.PROP_PROFILE_ROOT_IU);
+ policy.setVisibleInstalledIUQuery(new UserVisibleRootQuery());
else
- queryContext.setVisibleInstalledIUProperty(null);
+ policy.setVisibleInstalledIUQuery(InstallableUnitQuery.ANY);
+ RepositoryTracker tracker = getRepositoryTracker();
if (getPreferenceStore().getBoolean(PreferenceConstants.PREF_HIDE_SYSTEM_REPOS)) {
- queryContext.setArtifactRepositoryFlags(IRepositoryManager.REPOSITORIES_NON_SYSTEM);
- queryContext.setMetadataRepositoryFlags(IRepositoryManager.REPOSITORIES_NON_SYSTEM);
+ tracker.setArtifactRepositoryFlags(IRepositoryManager.REPOSITORIES_NON_SYSTEM);
+ tracker.setMetadataRepositoryFlags(IRepositoryManager.REPOSITORIES_NON_SYSTEM);
} else {
- queryContext.setArtifactRepositoryFlags(IRepositoryManager.REPOSITORIES_ALL);
- queryContext.setMetadataRepositoryFlags(IRepositoryManager.REPOSITORIES_ALL);
+ tracker.setArtifactRepositoryFlags(IRepositoryManager.REPOSITORIES_ALL);
+ tracker.setMetadataRepositoryFlags(IRepositoryManager.REPOSITORIES_ALL);
}
- queryContext.setShowLatestVersionsOnly(getPreferenceStore().getBoolean(PreferenceConstants.PREF_COLLAPSE_IU_VERSIONS));
- queryContext.setUseCategories(getPreferenceStore().getBoolean(PreferenceConstants.PREF_USE_CATEGORIES));
+ // store in ui prefs
+ policy.setShowLatestVersionsOnly(getPreferenceStore().getBoolean(PreferenceConstants.PREF_COLLAPSE_IU_VERSIONS));
+ policy.setGroupByCategory(getPreferenceStore().getBoolean(PreferenceConstants.PREF_USE_CATEGORIES));
+ }
+
+ private RepositoryTracker getRepositoryTracker() {
+ return (RepositoryTracker) ServiceHelper.getService(ProvUIActivator.getContext(), RepositoryTracker.class.getName());
}
void initializePolicy() {
policy = new Policy();
// Manipulate the default query context according to our preferences
- IUViewQueryContext queryContext = new IUViewQueryContext(IUViewQueryContext.AVAILABLE_VIEW_BY_REPO);
- policy.setQueryContext(queryContext);
- updateForPreferences(queryContext);
- policy.setPlanValidator(new PlanValidator() {
- public boolean continueWorkingWithPlan(ProvisioningPlan plan, Shell shell) {
- if (plan == null)
- return false;
- return true;
- }
- });
- policy.setProfileChooser(new IProfileChooser() {
- public String getProfileId(Shell shell) {
- // TODO would be nice if the profile chooser dialog let you
- // create a new profile
- ProvElementContentProvider provider = new ProvElementContentProvider();
- if (provider.getElements(new Profiles(getPolicy())).length == 0) {
- AddProfileDialog dialog = new AddProfileDialog(shell, new String[0]);
- if (dialog.open() == Window.OK) {
- return dialog.getAddedProfileId();
- }
- return null;
- }
-
- ListDialog dialog = new ListDialog(shell);
- dialog.setTitle(ProvAdminUIMessages.MetadataRepositoriesView_ChooseProfileDialogTitle);
- dialog.setLabelProvider(new ProvElementLabelProvider());
- dialog.setInput(new Profiles(getPolicy()));
- dialog.setContentProvider(provider);
- dialog.open();
- Object[] result = dialog.getResult();
- if (result != null && result.length > 0) {
- IProfile profile = (IProfile) ProvUI.getAdapter(result[0], IProfile.class);
- if (profile != null)
- return profile.getProfileId();
- }
- return null;
- }
- });
- policy.setRepositoryManipulator(new ColocatedRepositoryManipulator(policy, null));
+ updateForPreferences();
}
public Policy getPolicy() {
return policy;
}
+
+ public ProvisioningUI getProvisioningUI(String profileId) {
+ return new ProvisioningUI(ProvisioningUI.getDefaultUI().getSession(), profileId, policy);
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIMessages.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIMessages.java
index 750c738a3..b91502737 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIMessages.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIMessages.java
@@ -24,20 +24,13 @@ public class ProvAdminUIMessages extends NLS {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, ProvAdminUIMessages.class);
}
- public static String AddArtifactRepositoryDialog_DuplicateURL;
- public static String AddArtifactRepositoryDialog_ManipulateRepositoryInstruction;
- public static String AddArtifactRepositoryDialog_OperationLabel;
public static String AddProfileDialog_Title;
- public static String AddMetadataRepositoryDialog_OperationLabel;
public static String MetadataRepositoriesView_AddRepositoryTooltip;
public static String MetadataRepositoriesView_AddRepositoryLabel;
- public static String MetadataRepositoriesView_ChooseProfileDialogTitle;
public static String MetadataRepositoriesView_RemoveRepositoryTooltip;
public static String ArtifactRepositoriesView_AddRepositoryTooltip;
public static String ArtifactRepositoriesView_AddRepositoryLabel;
public static String ArtifactRepositoriesView_RemoveRepositoryTooltip;
- public static String ArtifactRepositoriesView_RemoveRepositoryOperationLabel;
- public static String ProfilesView_ErrorRetrievingProfiles;
public static String ProfilesView_AddProfileTooltip;
public static String ProfilesView_AddProfileLabel;
public static String ProfilesView_RemoveProfileLabel;
@@ -53,7 +46,6 @@ public class ProvAdminUIMessages extends NLS {
public static String Ops_RemoveProfileOperationLabel;
public static String AddProfileDialog_OperationLabel;
public static String AddProfileDialog_DuplicateProfileID;
- public static String ProvView_RefreshCommandLabel;
public static String ProvView_RefreshCommandTooltip;
public static String ProfileRootPropertyName;
@@ -75,7 +67,6 @@ public class ProvAdminUIMessages extends NLS {
public static String IUGroup_TouchpointData;
public static String IUGroup_TouchpointType;
public static String IUGroup_Version;
- public static String IUProfilePropertiesGroup_InvalidProfileID;
public static String IUPropertiesGroup_DescriptionPropertyLabel;
public static String IUPropertiesGroup_NamePropertyLabel;
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java
index fb68eba51..c6d28b7e1 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java
@@ -12,9 +12,13 @@ package org.eclipse.equinox.internal.p2.ui.admin;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.ui.actions.RefreshAction;
import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants;
-import org.eclipse.equinox.internal.provisional.p2.ui.actions.RefreshAction;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.*;
+import org.eclipse.equinox.internal.p2.ui.viewers.*;
+import org.eclipse.equinox.p2.engine.IProfileRegistry;
+import org.eclipse.equinox.p2.operations.ProvisioningJob;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.action.*;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -25,6 +29,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.part.ViewPart;
+import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
/**
* This class supports the common characteristics for views that manipulate
@@ -33,10 +38,11 @@ import org.eclipse.ui.part.ViewPart;
* @since 3.4
*/
abstract class ProvView extends ViewPart {
- TreeViewer viewer;
+ protected TreeViewer viewer;
RefreshAction refreshAction;
private IPropertyChangeListener preferenceListener;
protected Display display;
+ private ProvisioningUI ui;
/**
* The constructor.
@@ -118,7 +124,7 @@ abstract class ProvView extends ViewPart {
protected abstract IAction getDoubleClickAction();
protected void makeActions() {
- refreshAction = new RefreshAction(viewer, viewer.getControl()) {
+ refreshAction = new RefreshAction(ProvisioningUI.getDefaultUI(), viewer, viewer.getControl()) {
protected void refresh() {
refreshAll(true);
}
@@ -172,10 +178,18 @@ abstract class ProvView extends ViewPart {
return viewer.getControl();
}
- IStructuredSelection getSelection() {
+ protected IStructuredSelection getSelection() {
return (IStructuredSelection) viewer.getSelection();
}
+ protected void run(ProvisioningJob job) {
+ IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) getSite().getService(IWorkbenchSiteProgressService.class);
+ if (service != null)
+ service.schedule(job);
+ else
+ job.runModal(new NullProgressMonitor());
+ }
+
protected void configureViewer(final TreeViewer treeViewer) {
viewer.setComparator(new IUComparator(IUComparator.IU_ID));
viewer.setComparer(new ProvElementComparer());
@@ -206,11 +220,11 @@ abstract class ProvView extends ViewPart {
}
protected void refreshUnderlyingModel() {
- // Default is to do nothing
+ // do nothing by default
}
- protected List getVisualProperties() {
- ArrayList list = new ArrayList(1);
+ protected List<String> getVisualProperties() {
+ ArrayList<String> list = new ArrayList<String>(1);
list.add(PreferenceConstants.PREF_SHOW_GROUPS_ONLY);
return list;
}
@@ -224,4 +238,14 @@ abstract class ProvView extends ViewPart {
// will get queried again.
viewer.setInput(getInput());
}
+
+ protected String getProfileId() {
+ return IProfileRegistry.SELF;
+ }
+
+ protected ProvisioningUI getProvisioningUI() {
+ if (ui == null)
+ ui = ProvAdminUIActivator.getDefault().getProvisioningUI(getProfileId());
+ return ui;
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RefreshArtifactRepositoriesOperation.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RefreshArtifactRepositoriesOperation.java
deleted file mode 100644
index a7754a95e..000000000
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RefreshArtifactRepositoriesOperation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.equinox.internal.p2.ui.admin;
-
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.RepositoryOperation;
-
-import java.net.URI;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
-import org.eclipse.ui.statushandlers.StatusManager;
-
-/**
- * @since 3.4
- *
- */
-public class RefreshArtifactRepositoriesOperation extends RepositoryOperation {
-
- /**
- * @param label
- * @param locations
- */
- public RefreshArtifactRepositoriesOperation(String label, URI[] locations) {
- super(label, locations);
- }
-
- public RefreshArtifactRepositoriesOperation(String label, int flags) {
- super(label, new URI[0]);
- try {
- this.locations = ProvisioningUtil.getArtifactRepositories(flags);
- } catch (ProvisionException e) {
- ProvUI.handleException(e, null, StatusManager.LOG);
- }
- }
-
- protected IStatus doBatchedExecute(IProgressMonitor monitor) throws ProvisionException {
- ProvisioningUtil.refreshArtifactRepositories(locations, monitor);
- return Status.OK_STATUS;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RefreshMetadataRepositoriesOperation.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RefreshMetadataRepositoriesOperation.java
deleted file mode 100644
index 44b086d09..000000000
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RefreshMetadataRepositoriesOperation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.equinox.internal.p2.ui.admin;
-
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.RepositoryOperation;
-
-import java.net.URI;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
-import org.eclipse.ui.statushandlers.StatusManager;
-
-/**
- * @since 3.4
- *
- */
-public class RefreshMetadataRepositoriesOperation extends RepositoryOperation {
-
- /**
- * @param label
- * @param locations
- */
- public RefreshMetadataRepositoriesOperation(String label, URI[] locations) {
- super(label, locations);
- }
-
- public RefreshMetadataRepositoriesOperation(String label, int flags) {
- super(label, new URI[0]);
- try {
- this.locations = ProvisioningUtil.getMetadataRepositories(flags);
- } catch (ProvisionException e) {
- ProvUI.handleException(e, null, StatusManager.LOG);
- }
- }
-
- protected IStatus doBatchedExecute(IProgressMonitor monitor) throws ProvisionException {
- // Clear the not found cache so that repos not found are reported again.
- ProvUI.clearRepositoriesNotFound();
- ProvisioningUtil.refreshMetadataRepositories(locations, monitor);
- return Status.OK_STATUS;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveArtifactRepositoryOperation.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveArtifactRepositoryOperation.java
deleted file mode 100644
index c5dda16d4..000000000
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveArtifactRepositoryOperation.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.ui.admin;
-
-import java.net.URI;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.RemoveRepositoryOperation;
-
-/**
- * Operation which removes the artifact repository with the given URL.
- *
- * @since 3.4
- */
-public class RemoveArtifactRepositoryOperation extends RemoveRepositoryOperation {
-
- public RemoveArtifactRepositoryOperation(String label, URI[] repoLocations) {
- super(label, repoLocations);
- }
-
- protected IStatus doBatchedExecute(IProgressMonitor monitor) throws ProvisionException {
- SubMonitor mon = SubMonitor.convert(monitor, locations.length);
- for (int i = 0; i < locations.length; i++) {
- ProvisioningUtil.removeArtifactRepository(locations[i]);
- mon.worked(1);
- }
- return okStatus();
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveMetadataRepositoryOperation.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveMetadataRepositoryOperation.java
deleted file mode 100644
index 7f99b5d3e..000000000
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveMetadataRepositoryOperation.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.ui.admin;
-
-import java.net.URI;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.RemoveRepositoryOperation;
-
-/**
- * Operation that removes the metadata repository with the given location.
- *
- * @since 3.4
- */
-public class RemoveMetadataRepositoryOperation extends RemoveRepositoryOperation {
-
- public RemoveMetadataRepositoryOperation(String label, URI[] repoLocations) {
- super(label, repoLocations);
- }
-
- protected IStatus doBatchedExecute(IProgressMonitor monitor) throws ProvisionException {
- SubMonitor mon = SubMonitor.convert(monitor, locations.length);
- for (int i = 0; i < locations.length; i++) {
- ProvisioningUtil.removeMetadataRepository(locations[i]);
- mon.worked(1);
- }
- return okStatus();
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java
new file mode 100644
index 000000000..94d1eec82
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ui.admin;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.p2.operations.ProvisioningJob;
+import org.eclipse.equinox.p2.operations.ProvisioningSession;
+
+/**
+ * Job that removes one or more profiles.
+ *
+ * @since 3.6
+ */
+public class RemoveProfilesJob extends ProvisioningJob {
+ String[] profileIds;
+
+ public RemoveProfilesJob(String label, ProvisioningSession session, String[] profileIds) {
+ super(label, session);
+ this.profileIds = profileIds;
+ }
+
+ public IStatus runModal(IProgressMonitor monitor) {
+ for (int i = 0; i < profileIds.length; i++) {
+ getSession().getProfileRegistry().removeProfile(profileIds[i]);
+ }
+ return Status.OK_STATUS;
+
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java
index fecff8b3e..cf21efabc 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java
@@ -10,22 +10,29 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
+import org.eclipse.equinox.internal.p2.ui.ProvUIImages;
import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.internal.provisional.p2.ui.*;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.RemoveRepositoryOperation;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.RepositoryContentProvider;
-import org.eclipse.equinox.internal.provisional.p2.ui.viewers.StructuredViewerProvisioningListener;
+import org.eclipse.equinox.internal.p2.ui.model.IRepositoryElement;
+import org.eclipse.equinox.internal.p2.ui.viewers.RepositoryContentProvider;
+import org.eclipse.equinox.internal.p2.ui.viewers.StructuredViewerProvisioningListener;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.operations.RepositoryTracker;
import org.eclipse.jface.action.*;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.dialogs.PropertyDialogAction;
+import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import org.eclipse.ui.statushandlers.StatusManager;
/**
@@ -46,7 +53,14 @@ abstract class RepositoriesView extends ProvView {
}
public void run() {
- ProvisioningOperationRunner.run(getRemoveOperation(getSelection().toArray()), StatusManager.SHOW | StatusManager.LOG);
+ RepositoryTracker tracker = RepositoriesView.this.getRepositoryTracker();
+ Object[] elements = getSelection().toArray();
+ ArrayList<URI> uris = new ArrayList<URI>(elements.length);
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i] instanceof IRepositoryElement<?>)
+ uris.add(((IRepositoryElement<?>) elements[i]).getLocation());
+ }
+ tracker.removeRepositories(uris.toArray(new URI[uris.size()]), RepositoriesView.this.getProvisioningUI().getSession());
}
}
@@ -60,10 +74,10 @@ abstract class RepositoriesView extends ProvView {
public void run() {
Object[] elements = ((ITreeContentProvider) viewer.getContentProvider()).getElements(getInput());
- ArrayList urls = new ArrayList();
+ ArrayList<URI> urls = new ArrayList<URI>();
for (int i = 0; i < elements.length; i++)
- if (elements[i] instanceof IRepositoryElement)
- urls.add(((IRepositoryElement) elements[i]).getLocation());
+ if (elements[i] instanceof IRepositoryElement<?>)
+ urls.add(((IRepositoryElement<?>) elements[i]).getLocation());
openAddRepositoryDialog(getShell());
}
}
@@ -164,9 +178,9 @@ abstract class RepositoriesView extends ProvView {
}
- protected abstract int openAddRepositoryDialog(Shell shell);
+ protected abstract RepositoryTracker getRepositoryTracker();
- protected abstract RemoveRepositoryOperation getRemoveOperation(Object[] elements);
+ protected abstract int openAddRepositoryDialog(Shell shell);
protected abstract String getAddCommandLabel();
@@ -179,14 +193,32 @@ abstract class RepositoriesView extends ProvView {
protected abstract String getRemoveCommandTooltip();
protected boolean isRepository(Object element) {
- return element instanceof IRepositoryElement;
+ return element instanceof IRepositoryElement<?>;
}
protected abstract int getListenerEventTypes();
- protected List getVisualProperties() {
- List list = super.getVisualProperties();
+ protected List<String> getVisualProperties() {
+ List<String> list = super.getVisualProperties();
list.add(PreferenceConstants.PREF_HIDE_SYSTEM_REPOS);
return list;
}
+
+ protected void refreshUnderlyingModel() {
+ IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) getSite().getAdapter(IWorkbenchSiteProgressService.class);
+ if (service != null) {
+ try {
+ service.run(true, false, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+ getRepositoryTracker().refreshRepositories(getRepositoryTracker().getKnownRepositories(getProvisioningUI().getSession()), getProvisioningUI().getSession(), monitor);
+ }
+ });
+ } catch (InvocationTargetException e) {
+ ProvUI.handleException(e, null, StatusManager.SHOW);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ } else
+ getRepositoryTracker().refreshRepositories(getRepositoryTracker().getKnownRepositories(getProvisioningUI().getSession()), getProvisioningUI().getSession(), new NullProgressMonitor());
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java
index 8d4f2655d..e94be5aac 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddArtifactRepositoryDialog.java
@@ -10,13 +10,10 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
-import java.net.URI;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.p2.ui.admin.*;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AddRepositoryDialog;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.*;
-import org.eclipse.equinox.internal.provisional.p2.ui.policy.*;
+import org.eclipse.equinox.internal.p2.ui.admin.ArtifactRepositoryTracker;
+import org.eclipse.equinox.internal.p2.ui.dialogs.AddRepositoryDialog;
+import org.eclipse.equinox.p2.operations.RepositoryTracker;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.swt.widgets.Shell;
/**
@@ -27,101 +24,17 @@ import org.eclipse.swt.widgets.Shell;
*/
public class AddArtifactRepositoryDialog extends AddRepositoryDialog {
- class ArtifactRepositoryManipulator extends RepositoryManipulator {
- RepositoryLocationValidator validator;
+ RepositoryTracker tracker;
- public AddRepositoryOperation getAddOperation(URI location) {
- return new AddArtifactRepositoryOperation(ProvAdminUIMessages.AddArtifactRepositoryDialog_OperationLabel, location);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.ui.policy.RepositoryManipulator#getAddOperationLabel()
- */
- public String getAddOperationLabel() {
- return ProvAdminUIMessages.AddArtifactRepositoryDialog_OperationLabel;
- }
-
- public String getManipulatorButtonLabel() {
- // Not used in this dialog
- return null;
- }
-
- public String getManipulatorLinkLabel() {
- // Not used in this dialog
- return null;
- }
-
- public RemoveRepositoryOperation getRemoveOperation(URI[] repoLocations) {
- return new RemoveArtifactRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, repoLocations);
- }
-
- public String getRemoveOperationLabel() {
- return ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel;
- }
-
- public RepositoryLocationValidator getRepositoryLocationValidator(Shell shell) {
- if (validator == null) {
- validator = new RepositoryLocationValidator() {
- public IStatus validateRepositoryLocation(URI location, boolean contactRepositories, IProgressMonitor monitor) {
- IStatus duplicateStatus = Status.OK_STATUS;
- URI[] knownRepositories = getKnownRepositories();
- for (int i = 0; i < knownRepositories.length; i++) {
- if (knownRepositories[i].equals(location)) {
- duplicateStatus = new Status(IStatus.ERROR, ProvAdminUIActivator.PLUGIN_ID, LOCAL_VALIDATION_ERROR, ProvAdminUIMessages.AddArtifactRepositoryDialog_DuplicateURL, null);
- break;
- }
- }
- return duplicateStatus;
- }
- };
- }
- return validator;
- }
-
- public boolean manipulateRepositories(Shell shell) {
- // Not used in this dialog
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.ui.policy.RepositoryManipulator#getKnownRepositories()
- */
- public URI[] getKnownRepositories() {
- try {
- return ProvisioningUtil.getArtifactRepositories(ProvAdminUIActivator.getDefault().getPolicy().getQueryContext().getArtifactRepositoryFlags());
- } catch (ProvisionException e) {
- return new URI[0];
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.ui.policy.RepositoryManipulator#getManipulatorInstructionString()
- */
- public String getManipulatorInstructionString() {
- // We don't have a manipulator
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.p2.ui.policy.RepositoryManipulator#getSiteNotFoundCorrectionString()
- */
- public String getRepositoryNotFoundInstructionString() {
- return ProvAdminUIMessages.AddArtifactRepositoryDialog_ManipulateRepositoryInstruction;
- }
-
- }
-
- RepositoryManipulator manipulator;
-
- public AddArtifactRepositoryDialog(Shell parentShell, Policy policy) {
- super(parentShell, policy);
+ public AddArtifactRepositoryDialog(Shell parentShell, ProvisioningUI ui) {
+ super(parentShell, ui);
}
- protected RepositoryManipulator getRepositoryManipulator() {
- if (manipulator == null) {
- manipulator = new ArtifactRepositoryManipulator();
+ protected RepositoryTracker getRepositoryTracker() {
+ if (tracker == null) {
+ tracker = new ArtifactRepositoryTracker(getProvisioningUI());
}
- return manipulator;
+ return tracker;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java
index bbf0d8b0e..8281f22bf 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddMetadataRepositoryDialog.java
@@ -10,12 +10,10 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
-import java.net.URI;
-import org.eclipse.equinox.internal.p2.ui.admin.AddMetadataRepositoryOperation;
-import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AddRepositoryDialog;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.AddRepositoryOperation;
-import org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy;
+import org.eclipse.equinox.internal.p2.ui.admin.MetadataRepositoryTracker;
+import org.eclipse.equinox.internal.p2.ui.dialogs.AddRepositoryDialog;
+import org.eclipse.equinox.p2.operations.RepositoryTracker;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.swt.widgets.Shell;
/**
@@ -26,11 +24,16 @@ import org.eclipse.swt.widgets.Shell;
*/
public class AddMetadataRepositoryDialog extends AddRepositoryDialog {
- public AddMetadataRepositoryDialog(Shell parentShell, Policy policy) {
- super(parentShell, policy);
+ RepositoryTracker tracker;
+
+ public AddMetadataRepositoryDialog(Shell parentShell, ProvisioningUI ui) {
+ super(parentShell, ui);
}
- protected AddRepositoryOperation getOperation(URI location) {
- return new AddMetadataRepositoryOperation(ProvAdminUIMessages.AddMetadataRepositoryDialog_OperationLabel, location);
+ protected RepositoryTracker getRepositoryTracker() {
+ if (tracker == null) {
+ tracker = new MetadataRepositoryTracker(getProvisioningUI());
+ }
+ return tracker;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddProfileDialog.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddProfileDialog.java
index 5b215dea5..7d5d88ce2 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddProfileDialog.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddProfileDialog.java
@@ -11,19 +11,15 @@
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIActivator;
-import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvisioningOperationRunner;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.AddProfileOperation;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.p2.ui.admin.*;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.statushandlers.StatusManager;
/**
* Dialog that allows a profile to be defined and added.
@@ -77,8 +73,9 @@ public class AddProfileDialog extends StatusDialog {
return;
}
addedProfileId = profileGroup.getProfileId();
- Map profileProperties = profileGroup.getProfileProperties();
- ProvisioningOperationRunner.run(new AddProfileOperation(ProvAdminUIMessages.AddProfileDialog_OperationLabel, addedProfileId, profileProperties), StatusManager.SHOW | StatusManager.LOG);
+ Map<String, String> profileProperties = profileGroup.getProfileProperties();
+ AddProfileJob job = new AddProfileJob(ProvAdminUIMessages.AddProfileDialog_OperationLabel, ProvisioningUI.getDefaultUI().getSession(), addedProfileId, profileProperties);
+ job.runModal(new NullProgressMonitor());
}
void verifyComplete() {
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUGroup.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUGroup.java
index 61d125416..e3729873a 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUGroup.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Composite;
@@ -38,7 +38,7 @@ public abstract class IUGroup {
}
public IInstallableUnit getIU() {
- return (IInstallableUnit) ProvUI.getAdapter(iuElement, IInstallableUnit.class);
+ return ProvUI.getAdapter(iuElement, IInstallableUnit.class);
}
public void updateIU() {
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationGroup.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationGroup.java
index 158a70ace..9e898e6ee 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationGroup.java
@@ -10,14 +10,19 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
-import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
+import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.metadata.*;
+
+import java.util.Collection;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIActivator;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.IRequirement;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
@@ -154,23 +159,25 @@ public class IUImplementationGroup extends IUGroup {
if (type != null) {
touchpointType.setText(type.getId());
}
- ITouchpointData[] data = iu.getTouchpointData();
- String[] items = new String[data.length];
- for (int i = 0; i < data.length; i++) {
- items[i] = data[i].toString();
+ java.util.List<ITouchpointData> data = iu.getTouchpointData();
+ String[] items = new String[data.size()];
+ for (int i = 0; i < data.size(); i++) {
+ items[i] = data.get(i).toString();
}
touchpointData.setItems(items);
- IRequiredCapability[] req = iu.getRequiredCapabilities();
- items = new String[req.length];
- for (int i = 0; i < req.length; i++) {
- items[i] = req[i].toString();
+ Collection<IRequirement> reqs = iu.getRequiredCapabilities();
+ items = new String[reqs.size()];
+ int j = 0;
+ for (IRequirement req : reqs) {
+ items[j++] = req.toString();
}
requiredCapabilities.setItems(items);
- IProvidedCapability[] prov = iu.getProvidedCapabilities();
- items = new String[prov.length];
- for (int i = 0; i < prov.length; i++) {
- items[i] = prov[i].toString();
+ Collection<IProvidedCapability> prov = iu.getProvidedCapabilities();
+ items = new String[prov.size()];
+ int i = 0;
+ for (IProvidedCapability capability : prov) {
+ items[i++] = capability.toString();
}
providedCapabilities.setItems(items);
}
@@ -180,10 +187,10 @@ public class IUImplementationGroup extends IUGroup {
if (iuElement == null || iuElement instanceof IInstallableUnit) {
InstallableUnitDescription unit = new InstallableUnitDescription();
unit.setId(id.getText().trim());
- unit.setVersion(new Version(version.getText().trim()));
+ unit.setVersion(Version.create(version.getText().trim()));
unit.setProperty(IInstallableUnit.NAMESPACE_IU_ID, namespace.getText().trim());
// TODO this is bogus because we don't let user provide a touchpoint type version
- unit.setTouchpointType(MetadataFactory.createTouchpointType(touchpointType.getText().trim(), new Version("1.0.0"))); //$NON-NLS-1$
+ unit.setTouchpointType(MetadataFactory.createTouchpointType(touchpointType.getText().trim(), Version.create("1.0.0"))); //$NON-NLS-1$
iuElement = MetadataFactory.createInstallableUnit(unit);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationPropertyPage.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationPropertyPage.java
index 8a679d479..04a751e26 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationPropertyPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationPropertyPage.java
@@ -11,9 +11,9 @@
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -31,7 +31,7 @@ public class IUImplementationPropertyPage extends PropertyPage {
private IUImplementationGroup iuGroup;
protected Control createContents(Composite parent) {
- IInstallableUnit iu = (IInstallableUnit) ProvUI.getAdapter(getElement(), IInstallableUnit.class);
+ IInstallableUnit iu = ProvUI.getAdapter(getElement(), IInstallableUnit.class);
if (iu == null) {
Label label = new Label(parent, SWT.DEFAULT);
label.setText(ProvAdminUIMessages.No_Property_Item_Selected);
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java
index e71fd366e..468b5ed93 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java
@@ -11,19 +11,14 @@
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.InstalledIUElement;
-import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil;
-import org.eclipse.osgi.util.NLS;
+import org.eclipse.equinox.internal.p2.ui.model.InstalledIUElement;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.statushandlers.StatusManager;
/**
* An IUPropertiesGroup is a reusable UI component that displays and edits the
@@ -68,7 +63,7 @@ public class IUProfilePropertiesGroup extends IUGroup {
if (iuElement == null || !(iuElement instanceof InstalledIUElement)) {
return;
}
- String[] propNames = new String[] {IInstallableUnit.PROP_PROFILE_ROOT_IU};
+ String[] propNames = new String[] {IProfile.PROP_PROFILE_ROOT_IU};
String[] userPropNames = new String[] {ProvAdminUIMessages.ProfileRootPropertyName};
for (int i = 0; i < propNames.length; i++) {
TableItem item = new TableItem(propertiesTable, SWT.NULL);
@@ -80,11 +75,6 @@ public class IUProfilePropertiesGroup extends IUGroup {
}
private IProfile getProfile(InstalledIUElement element) {
- try {
- return ProvisioningUtil.getProfile(element.getProfileId());
- } catch (ProvisionException e) {
- ProvUI.handleException(e, NLS.bind(ProvAdminUIMessages.IUProfilePropertiesGroup_InvalidProfileID, element.getProfileId()), StatusManager.LOG);
- return null;
- }
+ return ProvisioningUI.getDefaultUI().getSession().getProfileRegistry().getProfile(element.getProfileId());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUPropertiesGroup.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUPropertiesGroup.java
index 6c766444b..ac7b80810 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUPropertiesGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUPropertiesGroup.java
@@ -12,8 +12,7 @@
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.internal.provisional.p2.ui.IUPropertyUtils;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
@@ -67,7 +66,7 @@ public class IUPropertiesGroup extends IUGroup {
String[] userPropNames = new String[] {ProvAdminUIMessages.IUPropertiesGroup_NamePropertyLabel, ProvAdminUIMessages.IUPropertiesGroup_DescriptionPropertyLabel, ProvAdminUIMessages.IUPropertiesGroup_ProviderPropertyLabel};
for (int i = 0; i < propNames.length; i++) {
TableItem item = new TableItem(propertiesTable, SWT.NULL);
- String value = IUPropertyUtils.getIUProperty(getIU(), propNames[i]);
+ String value = getIU().getProperty(propNames[i], null);
if (value != null)
item.setText(new String[] {userPropNames[i], value});
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/InstalledIUPropertyPage.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/InstalledIUPropertyPage.java
index f9aa001be..7694a0138 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/InstalledIUPropertyPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/InstalledIUPropertyPage.java
@@ -11,7 +11,7 @@
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.InstalledIUElement;
+import org.eclipse.equinox.internal.p2.ui.model.InstalledIUElement;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java
index b67f72f14..07f546092 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java
@@ -16,10 +16,8 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIActivator;
-import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProfileFactory;
+import org.eclipse.equinox.internal.p2.ui.admin.*;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridData;
@@ -42,7 +40,6 @@ public class ProfileGroup {
Text cache;
Text name;
Text description;
- Text flavor;
Text environments;
Text nl;
IProfile profile;
@@ -122,9 +119,6 @@ public class ProfileGroup {
label = new Label(composite, SWT.NONE);
label.setText(ProvAdminUIMessages.ProfileGroup_Flavor);
- flavor = new Text(composite, SWT.BORDER);
- flavor.setLayoutData(gd);
- setEditable(flavor, profile == null, listener);
label = new Label(composite, SWT.NONE);
label.setText(ProvAdminUIMessages.ProfileGroup_Environments);
@@ -146,7 +140,6 @@ public class ProfileGroup {
location.setText(ProfileFactory.getDefaultLocation());
environments.setText(ProfileFactory.getDefaultEnvironments());
nl.setText(ProfileFactory.getDefaultNL());
- flavor.setText(ProfileFactory.getDefaultFlavor());
} else {
String value = profile.getProfileId();
// Should not happen, profiles must have an id, but just in case.
@@ -172,8 +165,6 @@ public class ProfileGroup {
if (value != null) {
description.setText(value);
}
- value = profile.getProperty(IProfile.PROP_FLAVOR);
- flavor.setText(value != null ? value : ProfileFactory.getDefaultFlavor());
value = profile.getProperty(IProfile.PROP_ENVIRONMENTS);
if (value != null) {
@@ -186,9 +177,9 @@ public class ProfileGroup {
}
}
- public Map getProfileProperties() {
+ public Map<String, String> getProfileProperties() {
if (profile == null) {
- Map profileProperties = new HashMap();
+ Map<String, String> profileProperties = new HashMap<String, String>();
String value = location.getText().trim();
if (value.length() > 0) {
@@ -207,10 +198,6 @@ public class ProfileGroup {
if (value.length() > 0) {
profileProperties.put(IProfile.PROP_DESCRIPTION, value);
}
- value = flavor.getText().trim();
- if (value.length() > 0) {
- profileProperties.put(IProfile.PROP_FLAVOR, value);
- }
value = environments.getText().trim();
if (value.length() > 0) {
profileProperties.put(IProfile.PROP_ENVIRONMENTS, value);
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfilePropertyPage.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfilePropertyPage.java
index 374a7f01b..cea15ad83 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfilePropertyPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfilePropertyPage.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;
@@ -28,7 +28,7 @@ public class ProfilePropertyPage extends PropertyPage {
private ProfileGroup profileGroup;
protected Control createContents(Composite parent) {
- IProfile profile = (IProfile) ProvUI.getAdapter(getElement(), IProfile.class);
+ IProfile profile = ProvUI.getAdapter(getElement(), IProfile.class);
if (profile == null) {
Label label = new Label(parent, SWT.DEFAULT);
label.setText(ProvAdminUIMessages.No_Property_Item_Selected);
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java
index 8cd83d6a1..7c28fc184 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
-import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
-
import java.util.Map;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
-import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement;
+import org.eclipse.equinox.internal.p2.ui.model.IRepositoryElement;
+import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -28,7 +27,7 @@ import org.eclipse.ui.dialogs.PropertyPage;
* @since 3.4
*/
public class RepositoryImplementationPropertyPage extends PropertyPage {
- private IRepositoryElement repositoryElement;
+ private IRepositoryElement<?> repositoryElement;
private Composite composite;
private Text name;
private Text location;
@@ -106,9 +105,9 @@ public class RepositoryImplementationPropertyPage extends PropertyPage {
}
private void initializeFields() {
- IRepositoryElement element = getRepositoryElement();
+ IRepositoryElement<?> element = getRepositoryElement();
if (element != null) {
- IRepository repo = getRepositoryElement().getRepository(null);
+ IRepository<?> repo = getRepositoryElement().getRepository(null);
location.setText(repo.getLocation().toString());
String value = repo.getName();
if (value != null)
@@ -127,9 +126,9 @@ public class RepositoryImplementationPropertyPage extends PropertyPage {
private void initializeTable() {
if (getRepositoryElement() != null) {
- Map repoProperties = getRepositoryElement().getRepository(null).getProperties();
+ Map<String, String> repoProperties = getRepositoryElement().getRepository(null).getProperties();
if (repoProperties != null) {
- String[] propNames = (String[]) repoProperties.keySet().toArray(new String[repoProperties.size()]);
+ String[] propNames = repoProperties.keySet().toArray(new String[repoProperties.size()]);
for (int i = 0; i < propNames.length; i++) {
TableItem item = new TableItem(propertiesTable, SWT.NULL);
item.setText(new String[] {propNames[i], repoProperties.get(propNames[i]).toString()});
@@ -138,9 +137,9 @@ public class RepositoryImplementationPropertyPage extends PropertyPage {
}
}
- private IRepositoryElement getRepositoryElement() {
+ private IRepositoryElement<?> getRepositoryElement() {
if (repositoryElement == null) {
- repositoryElement = (IRepositoryElement) ProvUI.getAdapter(getElement(), IRepositoryElement.class);
+ repositoryElement = ProvUI.getAdapter(getElement(), IRepositoryElement.class);
}
return repositoryElement;
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/messages.properties b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/messages.properties
index b5f968204..a818c8b06 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/messages.properties
@@ -17,24 +17,16 @@ ProvisioningPrefPage_UseCategories=Show IUs by &category in repository views
InstalledIUPropertyPage_NoInfoAvailable=No profile-specific properties are available.
AddProfileDialog_Title=Add Profile
AddProfileDialog_OperationLabel=Add Profile
-AddMetadataRepositoryDialog_OperationLabel=Add Metadata Repository
-AddArtifactRepositoryDialog_DuplicateURL=Duplicate URL
-AddArtifactRepositoryDialog_ManipulateRepositoryInstruction=You can add and remove artifact repositories in the Artifact Repositories view.
-AddArtifactRepositoryDialog_OperationLabel=Add Artifact Repository
MetadataRepositoriesView_AddRepositoryLabel=Add repository...
MetadataRepositoriesView_AddRepositoryTooltip=Add a new metadata repository
RepositoriesView_RemoveCommandLabel=Remove
MetadataRepositoriesView_RemoveRepositoryTooltip=Remove the selected metadata repositories
-MetadataRepositoriesView_ChooseProfileDialogTitle=Choose Profile
-ArtifactRepositoriesView_RemoveRepositoryOperationLabel=Remove Artifact Repositories
ArtifactRepositoriesView_AddRepositoryLabel=Add repository...
ArtifactRepositoriesView_AddRepositoryTooltip=Add a new artifact repository
ArtifactRepositoriesView_RemoveRepositoryTooltip=Remove the selected artifact repositories
-ProfilesView_ErrorRetrievingProfiles=Error retrieving profiles
ProfilesView_AddProfileTooltip=Add a new profile
ProvView_RefreshCommandTooltip=Refresh the items in the view.
ProfilesView_AddProfileLabel=Add profile...
-ProvView_RefreshCommandLabel=Refresh
ProfilesView_RemoveProfileLabel=Remove
ProfilesView_RemoveProfileTooltip=Remove the selected profiles
AddProfileDialog_DuplicateProfileID=The profile ID is already in use.
@@ -57,7 +49,6 @@ IUGroup_TouchpointData=Touchpoint &data:
IUGroup_RequiredCapabilities=&Required capabilities:
IUGroup_ProvidedCapabilities=&Provided capabilities:
IUGroup_IU_ID_Required=Must set an IU ID
-IUProfilePropertiesGroup_InvalidProfileID=Profile id {0} not valid.
IUPropertiesGroup_DescriptionPropertyLabel=Description
IUPropertiesGroup_NamePropertyLabel=Name
IUPropertiesGroup_ProviderPropertyLabel=Provider

Back to the top