Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2011-04-04 11:57:14 -0400
committerPascal Rapicault2011-04-04 11:57:14 -0400
commita2658d4c3f9cc96eeb92330eb630696b91493598 (patch)
treeafa6599833d8a5eedc9a2b4f67b600a311616cff
parent75109b444b9d902e0835a9a768bab57e5c3cbc94 (diff)
downloadrt.equinox.p2-a2658d4c3f9cc96eeb92330eb630696b91493598.tar.gz
rt.equinox.p2-a2658d4c3f9cc96eeb92330eb630696b91493598.tar.xz
rt.equinox.p2-a2658d4c3f9cc96eeb92330eb630696b91493598.zip
Initial contrib for import / export functionality
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/.classpath7
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/.project39
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.jdt.core.prefs329
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.jdt.ui.prefs57
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.pde.core.prefs4
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF38
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/OSGI-INF/importexport.xml8
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/P2 Replication.launch429
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/build.properties8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/icons/install_wiz.gifbin0 -> 3550 bytes
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/plugin.properties9
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/plugin.xml49
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/IUDetail.java58
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java25
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Constants.java15
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java138
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java65
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties45
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractImportPage.java129
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java467
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractWizard.java44
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java166
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportWizard.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java368
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationWizard.java57
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java365
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java129
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FConstants.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java237
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FWriter.java62
30 files changed, 3414 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/.classpath b/bundles/org.eclipse.equinox.p2.ui.importexport/.classpath
new file mode 100755
index 000000000..64c5e31b7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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.importexport/.project b/bundles/org.eclipse.equinox.p2.ui.importexport/.project
new file mode 100755
index 000000000..253aaf9e5
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.p2.importexport</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 000000000..5e1105ff0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,329 @@
+#Mon Dec 21 23:16:26 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+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=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=jsr14
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+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=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=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
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+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.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+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.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
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+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_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
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=800
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.jdt.ui.prefs
new file mode 100755
index 000000000..014501b61
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Sun Sep 23 11:57:54 EDT 2007
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_core
+formatter_settings_version=11
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=;
+org.eclipse.jdt.ui.ondemandthreshold=3
+org.eclipse.jdt.ui.staticondemandthreshold=3
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.format_source_code=true
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.pde.core.prefs
new file mode 100755
index 000000000..7913d20db
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF
new file mode 100755
index 000000000..a379be303
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF
@@ -0,0 +1,38 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.equinox.p2.importexport;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.equinox.p2.ui,
+ org.eclipse.equinox.p2.extensionlocation,
+ org.eclipse.equinox.p2.metadata;bundle-version="2.1.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
+ CDC-1.1/Foundation-1.1
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.equinox.internal.p2.metadata.repository.io,
+ org.eclipse.equinox.internal.p2.persistence,
+ org.eclipse.equinox.internal.p2.ui,
+ org.eclipse.equinox.internal.p2.ui.dialogs,
+ org.eclipse.equinox.internal.p2.ui.model,
+ org.eclipse.equinox.internal.p2.ui.viewers,
+ org.eclipse.equinox.internal.provisional.p2.director,
+ org.eclipse.equinox.p2.core;version="2.0.0",
+ org.eclipse.equinox.p2.engine;version="2.0.0",
+ org.eclipse.equinox.p2.engine.query;version="2.0.0",
+ org.eclipse.equinox.p2.metadata;version="2.0.0",
+ org.eclipse.equinox.p2.operations;version="2.0.0",
+ org.eclipse.equinox.p2.planner;version="2.0.0",
+ org.eclipse.equinox.p2.query;version="2.0.0",
+ org.eclipse.equinox.p2.repository;version="2.0.0",
+ org.eclipse.equinox.p2.repository.artifact;version="2.0.0",
+ org.eclipse.equinox.p2.repository.artifact.spi;version="2.0.0",
+ org.eclipse.equinox.p2.repository.metadata;version="2.0.0",
+ org.eclipse.equinox.p2.repository.metadata.spi;version="2.0.0"
+Service-Component: OSGI-INF/importexport.xml
+Export-Package: org.eclipse.equinox.internal.p2.importexport;version="1.3.0";x-friends:="org.eclipse.equinox.p2.tests",
+ org.eclipse.equinox.internal.p2.importexport.internal;x-friends:="org.eclipse.equinox.p2.tests"
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/OSGI-INF/importexport.xml b/bundles/org.eclipse.equinox.p2.ui.importexport/OSGI-INF/importexport.xml
new file mode 100755
index 000000000..e8b40f21a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/OSGI-INF/importexport.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="P2 Import and Export">
+ <implementation class="org.eclipse.equinox.internal.p2.importexport.internal.ImportExportImpl"/>
+ <service>
+ <provide interface="org.eclipse.equinox.internal.p2.importexport.P2ImportExport"/>
+ </service>
+ <reference bind="bind" cardinality="1..1" interface="org.eclipse.equinox.p2.core.IProvisioningAgent" name="IProvisioningAgent" policy="static" unbind="unbind"/>
+</scr:component>
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/P2 Replication.launch b/bundles/org.eclipse.equinox.p2.ui.importexport/P2 Replication.launch
new file mode 100755
index 000000000..f46ec9b58
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/P2 Replication.launch
@@ -0,0 +1,429 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="true"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/P2 Replication"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="generateProfile" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/runtime-New_configuration"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-console"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.p2.profile=SDKProfile&#13;&#10;-Declipse.p2.data.area=${target_home}/p2"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<mapAttribute key="tracingOptions">
+<mapEntry key="org.eclipse.cdt.core/debug" value="true"/>
+<mapEntry key="org.eclipse.cdt.core/debug/ASTCache" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/deltaprocessor" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/formatter" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/index/locks" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/indexer/activity" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/indexer/problems" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/indexer/problems/inclusion" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/indexer/problems/scanner" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/indexer/problems/syntax" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/indexer/statistics" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/matchlocator" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/model" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/parser" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/parser/exceptions" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/scanner" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/search" value="false"/>
+<mapEntry key="org.eclipse.cdt.core/debug/typeresolver" value="false"/>
+<mapEntry key="org.eclipse.cdt.debug.mi.core/debug" value="true"/>
+<mapEntry key="org.eclipse.cdt.dsf.gdb/debug" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf.ui/debug" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf.ui/debug/disassembly" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf.ui/debug/stepping" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf.ui/debug/vm/atomicUpdate" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf.ui/debug/vm/cache" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf.ui/debug/vm/contentProvider" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf.ui/debug/vm/delta" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf.ui/debug/vm/presentationId" value=""/>
+<mapEntry key="org.eclipse.cdt.dsf/debug" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf/debug/executor" value="false"/>
+<mapEntry key="org.eclipse.cdt.dsf/debug/executorName" value=""/>
+<mapEntry key="org.eclipse.cdt.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.cdt.ui/debug/SemanticHighlighting" value="false"/>
+<mapEntry key="org.eclipse.cdt.ui/debug/contentassist" value="false"/>
+<mapEntry key="org.eclipse.cdt.ui/debug/folding" value="false"/>
+<mapEntry key="org.eclipse.core.contenttype/debug" value="false"/>
+<mapEntry key="org.eclipse.core.expressions/debug/TypeExtensionManager" value="false"/>
+<mapEntry key="org.eclipse.core.expressions/tracePropertyResolving" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/beginend" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/errorondeadlock" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/locks" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/shutdown" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/timing" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/delta" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/failure" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/interrupt" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/invoking" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/needbuildstack" value="false"/>
+<mapEntry key="org.eclipse.core.resources/build/stacktrace" value="false"/>
+<mapEntry key="org.eclipse.core.resources/contenttype" value="false"/>
+<mapEntry key="org.eclipse.core.resources/contenttype/cache" value="false"/>
+<mapEntry key="org.eclipse.core.resources/debug" value="false"/>
+<mapEntry key="org.eclipse.core.resources/history" value="false"/>
+<mapEntry key="org.eclipse.core.resources/natures" value="false"/>
+<mapEntry key="org.eclipse.core.resources/perf/builders" value="10000"/>
+<mapEntry key="org.eclipse.core.resources/perf/listeners" value="500"/>
+<mapEntry key="org.eclipse.core.resources/perf/save.participants" value="500"/>
+<mapEntry key="org.eclipse.core.resources/perf/snapshot" value="1000"/>
+<mapEntry key="org.eclipse.core.resources/preferences" value="false"/>
+<mapEntry key="org.eclipse.core.resources/refresh" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/markers" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/syncinfo" value="false"/>
+<mapEntry key="org.eclipse.core.resources/save/tree" value="false"/>
+<mapEntry key="org.eclipse.core.resources/strings" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/compatibility/debug" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/debug" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/debug/context" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/perf" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/perf/success" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/preferences/plugin" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/>
+<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/>
+<mapEntry key="org.eclipse.debug.core/debug" value="false"/>
+<mapEntry key="org.eclipse.debug.core/debug/commands" value="false"/>
+<mapEntry key="org.eclipse.debug.core/debug/events" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/breadcrumb" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/contextlaunching" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/launchhistory" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/contentProvider" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/deltas" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/model" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/presentationId" value=""/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/stateSaveRestore" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/updateSequence" value="false"/>
+<mapEntry key="org.eclipse.debug.ui/debug/viewers/viewer" value="false"/>
+<mapEntry key="org.eclipse.equinox.ds/debug" value="false"/>
+<mapEntry key="org.eclipse.equinox.ds/instantiate_all" value="false"/>
+<mapEntry key="org.eclipse.equinox.ds/performance" value="true"/>
+<mapEntry key="org.eclipse.equinox.ds/print_on_console" value="true"/>
+<mapEntry key="org.eclipse.equinox.p2.engine/engine/debug" value="false"/>
+<mapEntry key="org.eclipse.equinox.p2.engine/enginesession/debug" value="false"/>
+<mapEntry key="org.eclipse.equinox.p2.engine/profileregistry/debug" value="false"/>
+<mapEntry key="org.eclipse.equinox.preferences/general" value="false"/>
+<mapEntry key="org.eclipse.equinox.preferences/get" value="false"/>
+<mapEntry key="org.eclipse.equinox.preferences/set" value="false"/>
+<mapEntry key="org.eclipse.equinox.registry/debug" value="false"/>
+<mapEntry key="org.eclipse.equinox.registry/debug/events" value="false"/>
+<mapEntry key="org.eclipse.equinox.security.ui/debug" value="false"/>
+<mapEntry key="org.eclipse.equinox.security.ui/debug/storage" value="false"/>
+<mapEntry key="org.eclipse.equinox.security/debug" value="false"/>
+<mapEntry key="org.eclipse.equinox.security/debug/loginFramework" value="false"/>
+<mapEntry key="org.eclipse.help.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser" value="false"/>
+<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser/inprocess" value="false"/>
+<mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/>
+<mapEntry key="org.eclipse.help.webapp/debug" value="true"/>
+<mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/>
+<mapEntry key="org.eclipse.help/debug" value="true"/>
+<mapEntry key="org.eclipse.help/debug/context" value="false"/>
+<mapEntry key="org.eclipse.help/debug/search" value="false"/>
+<mapEntry key="org.eclipse.help/debug/toc" value="false"/>
+<mapEntry key="org.eclipse.jdt.apt.core/debug" value="false"/>
+<mapEntry key="org.eclipse.jdt.apt.core/debug/compilationEnv" value="false"/>
+<mapEntry key="org.eclipse.jdt.apt.core/debug/generatedFileMaps" value="false"/>
+<mapEntry key="org.eclipse.jdt.apt.core/debug/generatedFiles" value="false"/>
+<mapEntry key="org.eclipse.jdt.apt.pluggable.core/debug" value="false"/>
+<mapEntry key="org.eclipse.jdt.core.manipulation/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.core/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/builder" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/builder/stats" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/completion" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/cpresolution/advanced" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/cpresolution/failure" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/formatter" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/indexmanager" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/indexmanager/advanced" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javadelta/verbose" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javamodel" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javamodel/cache" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/resolution" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/sourcemapper" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/perf/completion" value="300"/>
+<mapEntry key="org.eclipse.jdt.core/perf/containerinitializer" value="5000"/>
+<mapEntry key="org.eclipse.jdt.core/perf/javadeltalistener" value="500"/>
+<mapEntry key="org.eclipse.jdt.core/perf/reconcile" value="1000"/>
+<mapEntry key="org.eclipse.jdt.core/perf/selection" value="300"/>
+<mapEntry key="org.eclipse.jdt.core/perf/variableinitializer" value="5000"/>
+<mapEntry key="org.eclipse.jdt.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.ui/debug/ASTProvider" value="false"/>
+<mapEntry key="org.eclipse.jdt.ui/debug/BreadcrumbItemDropDown" value="false"/>
+<mapEntry key="org.eclipse.jdt.ui/debug/ResultCollector" value="false"/>
+<mapEntry key="org.eclipse.jdt.ui/debug/TypeConstraints" value="false"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/content_assist/extensions" value="1000"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/content_assist_sorters/extensions" value=""/>
+<mapEntry key="org.eclipse.jdt.ui/perf/explorer/RefactorActionGroup" value="150"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/explorer/createPartControl" value="1300"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/explorer/makeActions" value="1000"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/search/participants" value="300"/>
+<mapEntry key="org.eclipse.jem.util/debug/loglevel" value="WARNING"/>
+<mapEntry key="org.eclipse.jem.util/debug/logtrace" value="false"/>
+<mapEntry key="org.eclipse.jem.util/debug/logtracefile" value="false"/>
+<mapEntry key="org.eclipse.jface.text.source/debug/RevisionRulerColumn" value="false"/>
+<mapEntry key="org.eclipse.jface.text/assert/TextSelection/validConstructorArguments" value="false"/>
+<mapEntry key="org.eclipse.jface.text/debug/AbstractInformationControlManager" value="false"/>
+<mapEntry key="org.eclipse.jface.text/debug/AnnotationPainter" value="false"/>
+<mapEntry key="org.eclipse.jface.text/debug/ContentAssistSubjectAdapters" value="false"/>
+<mapEntry key="org.eclipse.jface.text/debug/FastPartitioner/PositionCache" value="false"/>
+<mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/checkConditions" value="300"/>
+<mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/createChanges" value="300"/>
+<mapEntry key="org.eclipse.osgi/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/bundleTime" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/events" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/filter" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/loader" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/manifest" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/messageBundles" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/packageadmin" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/security" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/services" value="false"/>
+<mapEntry key="org.eclipse.osgi/debug/startlevel" value="false"/>
+<mapEntry key="org.eclipse.osgi/defaultprofile/buffersize" value="256"/>
+<mapEntry key="org.eclipse.osgi/defaultprofile/logfilename" value=""/>
+<mapEntry key="org.eclipse.osgi/defaultprofile/logsynchronously" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/converter/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/location" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin" value="false"/>
+<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin/resolver" value="false"/>
+<mapEntry key="org.eclipse.osgi/monitor/activation" value="false"/>
+<mapEntry key="org.eclipse.osgi/monitor/classes" value="false"/>
+<mapEntry key="org.eclipse.osgi/monitor/resources" value="false"/>
+<mapEntry key="org.eclipse.osgi/profile/benchmark" value="false"/>
+<mapEntry key="org.eclipse.osgi/profile/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/profile/impl" value="org.eclipse.osgi.internal.profile.DefaultProfileLogger"/>
+<mapEntry key="org.eclipse.osgi/profile/startup" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/cycles" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/debug" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/generics" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/imports" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/requires" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/uses" value="false"/>
+<mapEntry key="org.eclipse.osgi/resolver/wiring" value="false"/>
+<mapEntry key="org.eclipse.osgi/trace/activation" value="false"/>
+<mapEntry key="org.eclipse.osgi/trace/classLoading" value="false"/>
+<mapEntry key="org.eclipse.osgi/trace/filename" value="runtime.traces"/>
+<mapEntry key="org.eclipse.osgi/trace/filters" value="trace.properties"/>
+<mapEntry key="org.eclipse.pde.build/debug" value="false"/>
+<mapEntry key="org.eclipse.pde.core/cache" value="false"/>
+<mapEntry key="org.eclipse.pde.core/classpath" value="false"/>
+<mapEntry key="org.eclipse.pde.core/debug" value="true"/>
+<mapEntry key="org.eclipse.pde.core/validation" value="false"/>
+<mapEntry key="org.eclipse.team.core/backgroundevents" value="false"/>
+<mapEntry key="org.eclipse.team.core/debug" value="false"/>
+<mapEntry key="org.eclipse.team.core/refreshjob" value="false"/>
+<mapEntry key="org.eclipse.team.core/streams" value="false"/>
+<mapEntry key="org.eclipse.team.core/threading" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/>
+<mapEntry key="org.eclipse.team.cvs.core/debug" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/>
+<mapEntry key="org.eclipse.ui.browser/debug" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug/gc" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug/internalerror/openDialog" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug/markers" value="false"/>
+<mapEntry key="org.eclipse.ui.ide/debug/undomonitor" value="false"/>
+<mapEntry key="org.eclipse.ui.intro.universal/debug" value="true"/>
+<mapEntry key="org.eclipse.ui.intro.universal/trace/logInfo" value="true"/>
+<mapEntry key="org.eclipse.ui.intro.universal/trace/logPerformance" value="false"/>
+<mapEntry key="org.eclipse.ui.intro/debug" value="true"/>
+<mapEntry key="org.eclipse.ui.intro/debug/toolbar" value="false"/>
+<mapEntry key="org.eclipse.ui.intro/flags/noBrowser" value="false"/>
+<mapEntry key="org.eclipse.ui.intro/trace/logInfo" value="true"/>
+<mapEntry key="org.eclipse.ui.intro/trace/logPerformance" value="false"/>
+<mapEntry key="org.eclipse.ui.intro/trace/printHTML" value="false"/>
+<mapEntry key="org.eclipse.ui.navigator/debug" value="false"/>
+<mapEntry key="org.eclipse.ui.navigator/debug/dnd" value="false"/>
+<mapEntry key="org.eclipse.ui.navigator/debug/resolution" value="false"/>
+<mapEntry key="org.eclipse.ui.navigator/debug/setup" value="false"/>
+<mapEntry key="org.eclipse.ui.navigator/debug/sort" value="false"/>
+<mapEntry key="org.eclipse.ui.navigator/debug/viewermap" value="false"/>
+<mapEntry key="org.eclipse.ui.navigator/perf/explorer/createPartControl" value="1300"/>
+<mapEntry key="org.eclipse.ui.workbench/debug" value="false"/>
+<mapEntry key="org.eclipse.ui/debug" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/contributions" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/declaredImages" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/job.stale" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/showAllJobs" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/swtdebug" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/swtdebugglobal" value="false"/>
+<mapEntry key="org.eclipse.ui/debug/workingSets" value="false"/>
+<mapEntry key="org.eclipse.ui/experimental/menus" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener2" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPropertyChangeListener" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPartReference" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPageListener" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener2" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPerspectiveListener" value="false"/>
+<mapEntry key="org.eclipse.ui/perf/contentTypes" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/page.listeners" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/part.activate" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/part.control" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/part.create" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/part.init" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/part.input" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/part.listeners" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/perspective.create" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/perspective.listeners" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/perspective.switch" value="800"/>
+<mapEntry key="org.eclipse.ui/perf/showHeapStatus" value="true"/>
+<mapEntry key="org.eclipse.ui/perf/uijob" value="200"/>
+<mapEntry key="org.eclipse.ui/perf/workbench.restore" value="30000"/>
+<mapEntry key="org.eclipse.ui/perf/workbench.start" value="45000"/>
+<mapEntry key="org.eclipse.ui/trace/commands" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/contexts" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/contexts.performance" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/contexts.verbose" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers.performance" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers.verbose" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers.verbose.commandId" value=""/>
+<mapEntry key="org.eclipse.ui/trace/keyBindings" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/keyBindings.verbose" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/multipageeditor" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/operations" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/operations.verbose" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/sources" value="false"/>
+<mapEntry key="org.eclipse.update.configurator/debug" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug" value="true"/>
+<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/install" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/type" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/web" value="false"/>
+<mapEntry key="org.eclipse.wst.common.environment/debug" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/command" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/data" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/emitter" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/error" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/info" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/warning" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/ws_ant" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/ws_dt_cmd_engine" value="true"/>
+<mapEntry key="org.eclipse.wst.common.environment/trace/ws_framework" value="true"/>
+<mapEntry key="org.eclipse.wst.common.project.facet.core/actionSorting" value="false"/>
+<mapEntry key="org.eclipse.wst.common.project.facet.core/activation" value="false"/>
+<mapEntry key="org.eclipse.wst.common.project.facet.core/delegate/calls" value="false"/>
+<mapEntry key="org.eclipse.wst.common.project.facet.core/events/project" value="false"/>
+<mapEntry key="org.eclipse.wst.common.project.facet.core/events/project/stacktrace" value="false"/>
+<mapEntry key="org.eclipse.wst.dtd.ui/projectionperf" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/debug" value="true"/>
+<mapEntry key="org.eclipse.wst.sse.core/dom/adapter/notification/time" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/dom/adapter/notification/time/criteria" value="10"/>
+<mapEntry key="org.eclipse.wst.sse.core/filebuffers/leaks" value="true"/>
+<mapEntry key="org.eclipse.wst.sse.core/filebuffers/lifecycle" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/filebuffers/modelmanagement" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/format" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/structureddocument" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/structuredmodel/lifecycle" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/structuredmodel/locks" value="true"/>
+<mapEntry key="org.eclipse.wst.sse.core/structuredmodel/modelmanager" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/structuredmodel/state" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/tasks" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/tasks/detection" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/tasks/job" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/tasks/overalltime" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/tasks/preferences" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/tasks/registry" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.core/tasks/time" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields" value="true"/>
+<mapEntry key="org.eclipse.wst.sse.ui/contentOutline" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.wst.sse.ui/debug/reconcilerSpelling" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/debug/reconcilerSpelling/showProblems" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/debug/reconcilerValidators" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/debug/reconcilerjob" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/debug/tracefilter" value=""/>
+<mapEntry key="org.eclipse.wst.sse.ui/extendedconfigurationbuilder" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/extendedconfigurationbuilder/time" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder/contributetime" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugmenu" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugpopup" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugtoolbar" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/extendededitoractionbuilder/readtime" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/filemodelprovider/lifecyclelistener" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/filemodelprovider/modelstatelistener" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/filemodelprovider/operations" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/gotoNextAnnotation" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/preferences-properties" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/propertyChangeUpdateActionContributionItem" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/propertySheet" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/storagemodelprovider/elementstatelistener" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/storagemodelprovider/operations" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/structuredPresentationReconciler" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/structuredPresentationReconciler/time" value="false"/>
+<mapEntry key="org.eclipse.wst.sse.ui/transferbuilder/time" value="false"/>
+<mapEntry key="org.eclipse.wst.validation/debug" value="true"/>
+<mapEntry key="org.eclipse.wst.validation/extraValDetail" value=""/>
+<mapEntry key="org.eclipse.wst.validation/filter/allExcept" value=""/>
+<mapEntry key="org.eclipse.wst.validation/timings" value="false"/>
+<mapEntry key="org.eclipse.wst.validation/timings/tracefile" value=""/>
+<mapEntry key="org.eclipse.wst.validation/timings/useDoubles" value="false"/>
+<mapEntry key="org.eclipse.wst.validation/trace/level" value=""/>
+<mapEntry key="org.eclipse.wst.validation/v1" value="false"/>
+<mapEntry key="org.eclipse.wst.xml.core/debug" value="true"/>
+<mapEntry key="org.eclipse.wst.xml.core/debug/cmdocumentcache" value="false"/>
+<mapEntry key="org.eclipse.wst.xml.core/debug/cmdocumentmanager" value="false"/>
+<mapEntry key="org.eclipse.wst.xml.core/debug/tracefilter" value=""/>
+<mapEntry key="org.eclipse.wst.xml.ui/projectionperf" value="false"/>
+<mapEntry key="org.eclipse.wtp.common/debug/loglevel" value="WARNING"/>
+<mapEntry key="org.eclipse.wtp.common/debug/logtrace" value="false"/>
+<mapEntry key="org.eclipse.wtp.common/debug/logtracefile" value="false"/>
+</mapAttribute>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useProduct" value="true"/>
+<booleanAttribute key="usefeatures" value="false"/>
+</launchConfiguration>
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/build.properties b/bundles/org.eclipse.equinox.p2.ui.importexport/build.properties
new file mode 100755
index 000000000..b36b763b9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/build.properties
@@ -0,0 +1,8 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ OSGI-INF/importexport.xml,\
+ plugin.properties,\
+ icons/
+source.. = src/
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/icons/install_wiz.gif b/bundles/org.eclipse.equinox.p2.ui.importexport/icons/install_wiz.gif
new file mode 100644
index 000000000..7eee7c3a7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/icons/install_wiz.gif
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/plugin.properties b/bundles/org.eclipse.equinox.p2.ui.importexport/plugin.properties
new file mode 100755
index 000000000..bf4b99ab6
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/plugin.properties
@@ -0,0 +1,9 @@
+pluginName=p2 import and export
+providerName=Eclipse.org - Equinox
+category.name=p2
+export.name=Installed Software items to file
+import.name=Install Software items from file
+importfrominstallation.name=From existing installation
+export.description=Export the list of your installed software to the local file system.
+import.description=Install a set of software from the local file system.
+importfrominstance.description=Install a batch of software from another eclipse instance. \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/plugin.xml b/bundles/org.eclipse.equinox.p2.ui.importexport/plugin.xml
new file mode 100755
index 000000000..5422402cd
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/plugin.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.exportWizards">
+ <category
+ id="org.eclipse.equinox.p2.category"
+ name="%category.name">
+ </category>
+ <wizard
+ category="org.eclipse.equinox.p2.category"
+ class="org.eclipse.equinox.internal.p2.importexport.internal.wizard.ExportWizard"
+ icon="icons/install_wiz.gif"
+ id="org.eclipse.equinox.p2.replication.export"
+ name="%export.name">
+ <description>
+ %export.description
+ </description>
+ </wizard>
+ </extension>
+ <extension
+ point="org.eclipse.ui.importWizards">
+ <category
+ id="org.eclipse.equinox.p2.category"
+ name="%category.name">
+ </category>
+ <wizard
+ category="org.eclipse.equinox.p2.category"
+ class="org.eclipse.equinox.internal.p2.importexport.internal.wizard.ImportWizard"
+ icon="icons/install_wiz.gif"
+ id="org.eclipse.equinox.p2.replication.import"
+ name="%import.name">
+ <description>
+ %importfrominstance.description
+ </description>
+ </wizard>
+ <wizard
+ category="org.eclipse.equinox.p2.category"
+ class="org.eclipse.equinox.internal.p2.importexport.internal.wizard.ImportFromInstallationWizard"
+ icon="icons/install_wiz.gif"
+ id="org.eclipse.equinox.p2.replication.importfrominstallation"
+ name="%importfrominstallation.name">
+ <description>
+ %import.description
+ </description>
+ </wizard>
+ </extension>
+
+</plugin>
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/IUDetail.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/IUDetail.java
new file mode 100644
index 000000000..7eaa0e5b6
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/IUDetail.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport;
+
+import java.net.URI;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+
+public class IUDetail implements IAdaptable{
+
+ private final IInstallableUnit iu;
+ private final List<URI> referredRepo;
+
+ public IUDetail(IInstallableUnit iu, List<URI> uris) {
+ this.iu = iu;
+ referredRepo = uris;
+ }
+
+ public IInstallableUnit getIU() {
+ return iu;
+ }
+
+ public List<URI> getReferencedRepositories() {
+ return referredRepo;
+ }
+
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+ if (IInstallableUnit.class.equals(adapter))
+ return iu;
+ return null;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj instanceof IUDetail) {
+ if (iu.equals(((IUDetail)obj).getIU()))
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return iu.hashCode();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java
new file mode 100755
index 000000000..12175f4c2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport;
+
+import java.io.*;
+import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+
+public interface P2ImportExport {
+ List<IUDetail> importP2F(InputStream input) throws IOException;
+
+ IStatus exportP2F(OutputStream output, IInstallableUnit[] ius, IProgressMonitor monitor);
+
+ IStatus exportP2F(OutputStream output, List<IUDetail> ius, IProgressMonitor monitor);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Constants.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Constants.java
new file mode 100755
index 000000000..588b182c3
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Constants.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal;
+
+public interface Constants {
+ public final static String Bundle_ID = "org.eclipse.equinox.p2.importexport"; //$NON-NLS-1$
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java
new file mode 100755
index 000000000..e421e6f8b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal;
+
+import java.io.*;
+import java.net.URI;
+import java.util.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.p2.importexport.IUDetail;
+import org.eclipse.equinox.internal.p2.importexport.P2ImportExport;
+import org.eclipse.equinox.internal.p2.importexport.persistence.P2FParser;
+import org.eclipse.equinox.internal.p2.importexport.persistence.P2FWriter;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
+import org.eclipse.osgi.util.NLS;
+
+public class ImportExportImpl implements P2ImportExport {
+
+ private static final String SCHEME_FILE = "file"; //$NON-NLS-1$
+ public static final int IGNORE_LOCAL_REPOSITORY = 1;
+ public static final int CANNOT_FIND_REPOSITORY = 2;
+
+ private IProvisioningAgent agent = null;
+
+ public void bind(IProvisioningAgent agent) {
+ this.agent = agent;
+ }
+
+ public void unbind(IProvisioningAgent agent) {
+ if (this.agent == agent) {
+ this.agent = null;
+ }
+ }
+
+ public List<IUDetail> importP2F(InputStream input) throws IOException {
+ P2FParser parser = new P2FParser(Platform.getBundle(Constants.Bundle_ID).getBundleContext(), Constants.Bundle_ID);
+ parser.parse(input);
+ return parser.getFeatures();
+ }
+
+ public IStatus exportP2F(OutputStream output, IInstallableUnit[] ius, IProgressMonitor monitor) {
+ if (monitor == null)
+ monitor = new NullProgressMonitor();
+ SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.Replicator_ExportJobName, 1000);
+ IMetadataRepositoryManager repoManager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
+ URI[] uris = repoManager.getKnownRepositories(IMetadataRepositoryManager.REPOSITORIES_ALL);
+ Arrays.sort(uris, new Comparator<URI>() {
+ public int compare(URI o1, URI o2) {
+ String scheme1 = o1.getScheme();
+ String scheme2 = o2.getScheme();
+ if (scheme1.equals(scheme2))
+ return 0;
+ if (SCHEME_FILE.equals(scheme1)) {
+ return 1;
+ } else if (SCHEME_FILE.equals(scheme2)) {
+ return -1;
+ }
+ return 0;
+ }
+ });
+ List<IMetadataRepository> repos = new ArrayList<IMetadataRepository>(uris.length);
+ for (URI uri : uris) {
+ try {
+ IMetadataRepository repo = repoManager.loadRepository(uri, subMonitor.newChild(500 / uris.length, SubMonitor.SUPPRESS_ALL_LABELS));
+ repos.add(repo);
+ } catch (ProvisionException e) {
+ // ignore
+ }
+ }
+ subMonitor.setWorkRemaining(500);
+ List<IUDetail> features = new ArrayList<IUDetail>(ius.length);
+ SubMonitor sub2 = subMonitor.newChild(450, SubMonitor.SUPPRESS_ALL_LABELS);
+ sub2.setWorkRemaining(ius.length * 100);
+ MultiStatus queryRepoResult = new MultiStatus(Constants.Bundle_ID, 0, null, null);
+ for (IInstallableUnit iu : ius) {
+ List<URI> referredRepos = new ArrayList<URI>(1);
+ if (sub2.isCanceled())
+ throw new OperationCanceledException();
+ SubMonitor sub3 = sub2.newChild(100);
+ sub3.setWorkRemaining(repos.size() * 100);
+ for (IMetadataRepository repo : repos) {
+ if (SCHEME_FILE.equals(repo.getLocation().getScheme()) && referredRepos.size() > 0)
+ break;
+ IQueryResult<IInstallableUnit> result = repo.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, true)), sub3.newChild(100));
+ if (!result.isEmpty())
+ referredRepos.add(repo.getLocation());
+ }
+ sub3.setWorkRemaining(1).worked(1);
+ if (referredRepos.size() == 0) {
+ queryRepoResult.add(new Status(IStatus.WARNING, Constants.Bundle_ID, CANNOT_FIND_REPOSITORY, NLS.bind(Messages.Replicator_NotFoundInRepository, iu.getProperty(IInstallableUnit.PROP_NAME, Locale.getDefault().toString())), null));
+ } else {
+ if (SCHEME_FILE.equals(referredRepos.get(0).getScheme()))
+ queryRepoResult.add(new Status(IStatus.INFO, Constants.Bundle_ID, IGNORE_LOCAL_REPOSITORY, NLS.bind(Messages.Replicator_InstallFromLocal, iu.getProperty(IInstallableUnit.PROP_NAME, Locale.getDefault().toString())), null));
+ else {
+ IUDetail feature = new IUDetail(iu, referredRepos);
+ features.add(feature);
+ }
+ }
+ }
+ subMonitor.setWorkRemaining(50);
+ IStatus status = exportP2F(output, features, subMonitor);
+ if (status.isOK() && queryRepoResult.isOK())
+ return status;
+ MultiStatus rt = new MultiStatus(Constants.Bundle_ID, 0, new IStatus[] {queryRepoResult, status}, null, null);
+ return rt;
+ }
+
+ public IStatus exportP2F(OutputStream output, List<IUDetail> features, IProgressMonitor monitor) {
+ if (monitor == null)
+ monitor = new NullProgressMonitor();
+ SubMonitor sub = SubMonitor.convert(monitor, Messages.Replicator_SaveJobName, 100);
+ if (sub.isCanceled())
+ throw new OperationCanceledException();
+ try {
+ P2FWriter writer = new P2FWriter(output, null);
+ writer.write(features);
+ return Status.OK_STATUS;
+ } catch (UnsupportedEncodingException e) {
+ return new Status(IStatus.ERROR, Constants.Bundle_ID, e.getMessage(), e);
+ } finally {
+ sub.worked(100);
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java
new file mode 100755
index 000000000..af3ed4f42
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/Messages.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ public static String Column_Id;
+ public static String Column_Name;
+ public static String Column_Version;
+ public static String ExportPage_Title;
+ public static String ExportPage_Description;
+ public static String ExportPage_Label;
+ public static String ExportPage_DEST_ERRORMESSAGE;
+ public static String ExportPage_ERROR_CONFIG;
+ public static String ExportPage_EXPORT_WARNING;
+ public static String ExportPage_Fail;
+ public static String ExportPage_FILEDIALOG_TITLE;
+ public static String EXTENSION_ALL;
+ public static String EXTENSION_ALL_NAME;
+ public static String EXTENSION_P2F_NAME;
+ public static String EXTENSION_P2F;
+ public static String ExportPage_LABEL_EXPORTFILE;
+ public static String ExportPage_SuccessWithProblems;
+ public static String ExportWizard_WizardTitle;
+ public static String ImportPage_DESCRIPTION;
+ public static String ImportPage_DEST_ERROR;
+ public static String ImportPage_DESTINATION_LABEL;
+ public static String ImportPage_FILEDIALOG_TITLE;
+ public static String ImportPage_FILENOTFOUND;
+ public static String AbstractImportPage_HigherVersionInstalled;
+ public static String ImportPage_IMPORT_NOTIFICATION;
+ public static String ImportPage_InstallLatestVersion;
+ public static String ImportPage_QueryFeaturesJob;
+ public static String AbstractImportPage_SameVersionInstalled;
+ public static String ImportPage_TITLE;
+ public static String ImportWizard_WINDOWTITLE;
+ public static String Page_BUTTON_BROWSER;
+ public static String PAGE_NOINSTALLTION_ERROR;
+ public static String ImportFromInstallationPage_DESTINATION_LABEL;
+ public static String ImportFromInstallationPage_DIALOG_TITLE;
+ public static String ImportFromInstallationPage_INVALID_DESTINATION;
+ public static String ImportFromInstallationPage_DIALOG_DESCRIPTION;
+ public static String ImportFromInstallationPage_SELECT_COMPONENT;
+
+ public static String io_IncompatibleVersion;
+ public static String io_parseError;
+ public static String Replicator_ExportJobName;
+ public static String Replicator_InstallFromLocal;
+ public static String Replicator_NotFoundInRepository;
+ public static String Replicator_SaveJobName;
+
+ static {
+ NLS.initializeMessages(
+ "org.eclipse.equinox.internal.p2.importexport.internal.messages", Messages.class); //$NON-NLS-1$
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties
new file mode 100755
index 000000000..38e5279c8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties
@@ -0,0 +1,45 @@
+Column_Id=Id
+Column_Name=Name
+Column_Version=Version
+ExportPage_Title=P2 Export
+ExportPage_Description=Export a list of installed features and their repositories to the local file system.
+ExportPage_Label=Select the features to be exported:
+EXTENSION_ALL=*.*
+EXTENSION_ALL_NAME=All files(*.*)
+EXTENSION_P2F=*.p2f
+Page_BUTTON_BROWSER=Browse...
+ExportPage_DEST_ERRORMESSAGE=P2 installation file is not set, or is not a normal file.
+ExportPage_ERROR_CONFIG=Eclipse P2 is NOT properly configurated.
+ExportPage_EXPORT_WARNING=Can't find repository for below IUs. Please check the network connection.\n
+ExportPage_Fail=Selected features are failed to be exported, below problems are found:\n
+ExportPage_FILEDIALOG_TITLE=Export the list of installed features to file
+EXTENSION_P2F_NAME=P2 installation file(*.p2f)
+ExportPage_LABEL_EXPORTFILE=To P2 exported file:
+ExportPage_SuccessWithProblems=Selected features are successfully exported, however below features are ignored:\n
+ExportWizard_WizardTitle=Export
+PAGE_NOINSTALLTION_ERROR=No specific feature is selected.
+ImportPage_DESCRIPTION=Install a batch of features from the local file system.
+ImportPage_DEST_ERROR=Specified file doesn't exist or can't be read.
+ImportPage_DESTINATION_LABEL=Choose a p2 installation file:
+ImportPage_FILEDIALOG_TITLE=Import from file
+ImportPage_FILENOTFOUND=The specified file doesn't exist.
+AbstractImportPage_HigherVersionInstalled={0} (Disabled due to a higher version has been installed)
+ImportPage_IMPORT_NOTIFICATION=The installation job has been scheduled.
+ImportPage_InstallLatestVersion=Install latest version of selected features
+ImportPage_QueryFeaturesJob=Query selected features...
+AbstractImportPage_SameVersionInstalled={0} (Disabled due to it has been already installed)
+ImportPage_TITLE=P2 Import
+ImportWizard_WINDOWTITLE=Import
+ImportFromInstallationPage_DESTINATION_LABEL=Specify an existing Eclipse installation
+ImportFromInstallationPage_DIALOG_TITLE=P2 Import
+ImportFromInstallationPage_DIALOG_DESCRIPTION=Import features from the existing Eclipse's installation.
+ImportFromInstallationPage_INVALID_DESTINATION=Specify an valid eclipse installation.
+ImportFromInstallationPage_SELECT_COMPONENT=Select at least one available feature to be installed.
+io_IncompatibleVersion=\
+Metadata repository has incompatible version {0}; expected {1}
+io_parseError=\
+Error parsing .p2f file
+Replicator_ExportJobName=Exporting selected features...
+Replicator_InstallFromLocal=Aborted exporting feature \"{0}\" due to it's installed from local repository.
+Replicator_NotFoundInRepository=No enabled repository can find the feature \"{0}\" or that repository can't be loaded due to network issues.
+Replicator_SaveJobName=Exporting selected features to file...
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractImportPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractImportPage.java
new file mode 100644
index 000000000..2a2845a92
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractImportPage.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
+import org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
+import org.eclipse.jface.viewers.ICheckStateProvider;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.TableItem;
+
+public abstract class AbstractImportPage extends AbstractPage {
+
+ IProfile profile = null;
+ private final ProvisioningOperationWizard wizard;
+ private final ProvisioningUI ui;
+
+ public AbstractImportPage(String pageName, ProvisioningUI ui, ProvisioningOperationWizard wizard) {
+ super(pageName);
+ this.wizard = wizard;
+ this.ui = ui;
+ profile = getSelfProfile();
+ }
+
+ protected ProvisioningOperationWizard getProvisioningWizard() {
+ return wizard;
+ }
+
+ protected ProvisioningUI getProvisioningUI() {
+ return ui;
+ }
+
+ @Override
+ protected void createInstallationTable(Composite parent) {
+ super.createInstallationTable(parent);
+ viewer.getTable().addListener(SWT.Selection, new Listener() {
+
+ public void handleEvent(Event event) {
+ if( event.detail == SWT.CHECK ) {
+ if (hasInstalled(ProvUI.getAdapter(event.item.getData(), IInstallableUnit.class))) {
+ viewer.getTable().setRedraw(false);
+ ((TableItem)event.item).setChecked(false);
+ viewer.getTable().setRedraw(true);
+ }
+ }
+ }
+ });
+ }
+
+ public boolean hasInstalled(IInstallableUnit iu) {
+ IQueryResult<IInstallableUnit> results = profile.query(QueryUtil.createIUQuery(iu.getId(),
+ new VersionRange(iu.getVersion(), true, null, false)), null);
+ return !results.isEmpty();
+ }
+
+ public String getIUNameWithDetail(IInstallableUnit iu) {
+ IQueryResult<IInstallableUnit> results = profile.query(QueryUtil.createIUQuery(iu.getId(),
+ new VersionRange(iu.getVersion(), true, null, false)), null);
+ final String text = iu.getProperty(IProfile.PROP_NAME, null);
+ if (!results.isEmpty()) {
+ boolean hasHigherVersion = false;
+ boolean hasEqualVersion = false;
+ for (IInstallableUnit installedIU : results.toSet()) {
+ int compareValue = installedIU.getVersion().compareTo(iu.getVersion());
+ if (compareValue > 0) {
+ hasHigherVersion = true;
+ break;
+ } else if (compareValue == 0)
+ hasEqualVersion = true;
+ }
+ if (hasHigherVersion)
+ return NLS.bind(Messages.AbstractImportPage_HigherVersionInstalled, text);
+ else if (hasEqualVersion)
+ return NLS.bind(Messages.AbstractImportPage_SameVersionInstalled, text);
+ }
+ return text;
+ }
+
+ @Override
+ protected ICheckStateProvider getViewerDefaultState() {
+ return new ICheckStateProvider() {
+
+ public boolean isGrayed(Object element) {
+ return false;
+ }
+
+ public boolean isChecked(Object element) {
+ if (profile != null) {
+ IInstallableUnit iu = ProvUI.getAdapter(element, IInstallableUnit.class);
+ IQueryResult<IInstallableUnit> collector = profile.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, false)), new NullProgressMonitor());
+ if(collector.isEmpty()) {
+ return true;
+ }
+ }
+ return false;
+ }
+ };
+ }
+
+ @Override
+ protected void doFinish() throws Exception {
+ // do nothing
+ }
+
+
+ @Override
+ public boolean canFlipToNextPage() {
+ return isPageComplete();
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java
new file mode 100644
index 000000000..533777dda
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractPage.java
@@ -0,0 +1,467 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.equinox.internal.p2.importexport.P2ImportExport;
+import org.eclipse.equinox.internal.p2.importexport.internal.Constants;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
+import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
+import org.eclipse.equinox.internal.p2.ui.dialogs.ILayoutConstants;
+import org.eclipse.equinox.internal.p2.ui.viewers.DeferredQueryContentProvider;
+import org.eclipse.equinox.internal.p2.ui.viewers.IUColumnConfig;
+import org.eclipse.equinox.internal.p2.ui.viewers.IUDetailsLabelProvider;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.IProfileRegistry;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ICheckStateProvider;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Widget;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+public abstract class AbstractPage extends WizardPage implements Listener {
+
+ protected String currentMessage;
+ protected Button destinationBrowseButton;
+ protected Combo destinationNameField;
+ protected P2ImportExport importexportService = null;
+ protected CheckboxTableViewer viewer = null;
+ protected Exception finishException;
+ protected static IProfileRegistry profileRegistry = null;
+ protected static IProvisioningAgent agent = null;
+
+ class TableViewerComparator extends ViewerComparator {
+ private int sortColumn = 0;
+ private int lastSortColumn = 0;
+ private boolean ascending = false;
+ private boolean lastAscending = false;
+
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ IInstallableUnit iu1 = ProvUI.getAdapter(e1, IInstallableUnit.class);
+ IInstallableUnit iu2 = ProvUI.getAdapter(e2, IInstallableUnit.class);
+ if (iu1 != null && iu2 != null) {
+ if (viewer instanceof TableViewer) {
+ TableViewer tableViewer = (TableViewer) viewer;
+ IBaseLabelProvider baseLabel = tableViewer.getLabelProvider();
+ if (baseLabel instanceof ITableLabelProvider) {
+ ITableLabelProvider tableProvider = (ITableLabelProvider) baseLabel;
+ String e1p = tableProvider.getColumnText(e1, getSortColumn());
+ String e2p = tableProvider.getColumnText(e2, getSortColumn());
+ int result = getComparator().compare(e1p, e2p);
+ // Secondary column sort
+ if (result == 0) {
+ e1p = tableProvider.getColumnText(e1, lastSortColumn);
+ e2p = tableProvider.getColumnText(e2, lastSortColumn);
+ result = getComparator().compare(e1p, e2p);
+ return lastAscending ? result : (-1) * result;
+ }
+ return isAscending() ? result : (-1) * result;
+ }
+ }
+ // we couldn't determine a secondary sort, call it equal
+ return 0;
+ }
+ return super.compare(viewer, e1, e2);
+ }
+
+ /**
+ * @return Returns the sortColumn.
+ */
+ public int getSortColumn() {
+ return sortColumn;
+ }
+
+ /**
+ * @param sortColumn
+ * The sortColumn to set.
+ */
+ public void setSortColumn(int sortColumn) {
+ if (this.sortColumn != sortColumn) {
+ lastSortColumn = this.sortColumn;
+ lastAscending = this.ascending;
+ this.sortColumn = sortColumn;
+ }
+ }
+
+ /**
+ * @return Returns the ascending.
+ */
+ public boolean isAscending() {
+ return ascending;
+ }
+
+ /**
+ * @param ascending
+ * The ascending to set.
+ */
+ public void setAscending(boolean ascending) {
+ this.ascending = ascending;
+ }
+ }
+
+ static {
+ BundleContext context = Platform.getBundle(Constants.Bundle_ID).getBundleContext();
+ ServiceTracker<IProvisioningAgent, IProvisioningAgent> tracker = new ServiceTracker<IProvisioningAgent, IProvisioningAgent>(context, IProvisioningAgent.class, null);
+ tracker.open();
+ agent = tracker.getService();
+ tracker.close();
+ if (agent != null)
+ profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);
+ }
+
+ public AbstractPage(String pageName) {
+ super(pageName);
+ }
+
+ public AbstractPage(String pageName, String title,
+ ImageDescriptor titleImage) {
+ super(pageName, title, titleImage);
+ }
+
+ protected IProfile getSelfProfile() {
+ if (profileRegistry != null) {
+ String selfID = System.getProperty("eclipse.p2.profile"); //$NON-NLS-1$
+ if(selfID == null)
+ selfID = IProfileRegistry.SELF;
+ return profileRegistry.getProfile(selfID);
+ }
+ return null;
+ }
+
+ private void createColumns(TableViewer viewer) {
+ String[] titles = { Messages.Column_Name, Messages.Column_Version, Messages.Column_Id};
+ for (int i = 0; i < titles.length; i++) {
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setText(titles[i]);
+ column.getColumn().setResizable(true);
+ column.getColumn().setMoveable(true);
+ if (Messages.Column_Name.equals(titles[i]))
+ updateTableSorting(i);
+ final int columnIndex = i;
+ column.getColumn().addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateTableSorting(columnIndex);
+ }
+ });
+ }
+ }
+
+ protected void updateTableSorting(int columnIndex) {
+ TableViewerComparator comparator = (TableViewerComparator) viewer.getComparator();
+ // toggle direction if it's the same column
+ if (columnIndex == comparator.getSortColumn()) {
+ comparator.setAscending(!comparator.isAscending());
+ }
+ comparator.setSortColumn(columnIndex);
+ viewer.getTable().setSortColumn(
+ viewer.getTable().getColumn(columnIndex));
+ viewer.getTable().setSortDirection(
+ comparator.isAscending() ? SWT.UP : SWT.DOWN);
+ viewer.refresh(false);
+ }
+
+ protected abstract void createContents(Composite composite);
+
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+ initializeService();
+ Composite composite = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout(1, true);
+ layout.horizontalSpacing = 0;
+ layout.verticalSpacing = 5;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL
+ | GridData.HORIZONTAL_ALIGN_FILL));
+
+ createContents(composite);
+
+ // can not finish initially, but don't want to start with an error
+ // message either
+ if (!(validDestination() && validateOptionsGroup())) {
+ setPageComplete(false);
+ }
+
+ setControl(composite);
+ giveFocusToDestination();
+ Dialog.applyDialogFont(composite);
+ }
+
+ protected void createDestinationGroup(Composite parent) {
+ Composite composite = new Composite(parent, SWT.BORDER);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(
+ GridData.FILL, GridData.FILL, true, false));
+
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(getDestinationLabel());
+
+ destinationNameField = new Combo(composite, SWT.SINGLE | SWT.BORDER);
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.GRAB_HORIZONTAL);
+ destinationNameField.setLayoutData(data);
+ destinationNameField.addListener(SWT.Modify | SWT.Selection, this);
+ destinationBrowseButton = new Button(composite, SWT.PUSH);
+ destinationBrowseButton.setText(Messages.Page_BUTTON_BROWSER);
+ destinationBrowseButton.addListener(SWT.Selection, this);
+ destinationBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
+ }
+
+ protected IUColumnConfig[] getColumnConfig() {
+ return new IUColumnConfig[] {new IUColumnConfig(ProvUIMessages.ProvUI_NameColumnTitle, IUColumnConfig.COLUMN_NAME, ILayoutConstants.DEFAULT_PRIMARY_COLUMN_WIDTH),
+ new IUColumnConfig(ProvUIMessages.ProvUI_VersionColumnTitle, IUColumnConfig.COLUMN_VERSION, ILayoutConstants.DEFAULT_SMALL_COLUMN_WIDTH),
+ new IUColumnConfig(ProvUIMessages.ProvUI_IdColumnTitle, IUColumnConfig.COLUMN_ID, ILayoutConstants.DEFAULT_COLUMN_WIDTH)};
+ }
+
+ protected void createInstallationTable(final Composite parent) {
+ viewer = CheckboxTableViewer.newCheckList(parent, SWT.MULTI | SWT.BORDER);
+ final Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+ table.setLinesVisible(false);
+ viewer.setComparator(new TableViewerComparator());
+ createColumns(viewer);
+ viewer.setContentProvider(getContentProvider());
+ viewer.setLabelProvider(getLabelProvider());
+ parent.addControlListener(new ControlAdapter() {
+ private final int[] columnRate = new int[]{6, 2, 2};
+ @Override
+ public void controlResized(ControlEvent e) {
+ Rectangle area = parent.getClientArea();
+ Point size = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ ScrollBar vBar = table.getVerticalBar();
+ int width = area.width - table.computeTrim(0,0,0,0).width - vBar.getSize().x;
+ if (size.y > area.height + table.getHeaderHeight()) {
+ // Subtract the scrollbar width from the total column width
+ // if a vertical scrollbar will be required
+ Point vBarSize = vBar.getSize();
+ width -= vBarSize.x;
+ }
+ Point oldSize = table.getSize();
+ TableColumn[] columns = table.getColumns();
+ int hasUsed = 0, i = 0;
+ if (oldSize.x > area.width) {
+ // table is getting smaller so make the columns
+ // smaller first and then resize the table to
+ // match the client area width
+ for(; i < columns.length - 1; i++) {
+ columns[i].setWidth(width*columnRate[i]/10);
+ hasUsed += columns[i].getWidth();
+ }
+ columns[columns.length - 1].setWidth(width - hasUsed);
+ table.setSize(area.width, area.height);
+ } else {
+ // table is getting bigger so make the table
+ // bigger first and then make the columns wider
+ // to match the client area width
+ table.setSize(area.width, area.height);
+ for(; i < columns.length - 1; i++) {
+ columns[i].setWidth(width*columnRate[i]/10);
+ hasUsed += columns[i].getWidth();
+ }
+ columns[columns.length - 1].setWidth(width - hasUsed);
+ }
+ }
+ });
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updatePageCompletion();
+ }
+ });
+ ICheckStateProvider provider = getViewerDefaultState();
+ if (provider != null)
+ viewer.setCheckStateProvider(provider);
+ viewer.getControl().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+ viewer.getControl().setSize(300, 200);
+ viewer.setInput(getInput());
+ }
+
+ protected ICheckStateProvider getViewerDefaultState() {
+ return null;
+ }
+
+ protected ITableLabelProvider getLabelProvider() {
+ return new IUDetailsLabelProvider(null, getColumnConfig(), null);
+ }
+
+ protected IContentProvider getContentProvider() {
+ return new DeferredQueryContentProvider();
+ }
+
+ protected boolean determinePageCompletion() {
+ // validate groups in order of priority so error message is the most important one
+ boolean complete = validateDestinationGroup() && validateOptionsGroup();
+
+ // Avoid draw flicker by not clearing the error
+ // message unless all is valid.
+ if (complete) {
+ setErrorMessage(null);
+ } else {
+ setErrorMessage(currentMessage);
+ }
+
+ return complete;
+ }
+
+ protected abstract void doFinish() throws Exception;
+
+ protected int getBrowseDialogStyle() {
+ return SWT.OPEN;
+ }
+
+ /**
+ * returns the destination label
+ * @return non null string
+ */
+ protected abstract String getDestinationLabel();
+
+ /**
+ * Answer the contents of self's destination specification widget
+ *
+ * @return java.lang.String
+ */
+ protected String getDestinationValue() {
+ return destinationNameField.getText().trim();
+ }
+
+ /**
+ * return the title of dialog
+ * @return non null string
+ */
+ protected abstract String getDialogTitle();
+
+ protected abstract Object getInput();
+
+ protected abstract String getInvalidDestinationMessage();
+
+ protected String getNoOptionsMessage() {
+ return Messages.PAGE_NOINSTALLTION_ERROR;
+ }
+ protected abstract void giveFocusToDestination();
+
+ /**
+ * Open an appropriate destination browser so that the user can specify a
+ * source to import from
+ */
+ protected void handleDestinationBrowseButtonPressed() {
+ FileDialog dialog = new FileDialog(getContainer().getShell(),
+ getBrowseDialogStyle() | SWT.SHEET);
+ dialog.setText(getDialogTitle());
+ dialog.setFilterPath(getDestinationValue());
+ dialog.setFilterExtensions(new String[] {Messages.EXTENSION_P2F, Messages.EXTENSION_ALL});
+ dialog.setFilterNames(new String[] {Messages.EXTENSION_P2F_NAME, Messages.EXTENSION_ALL_NAME});
+ String selectedFileName = dialog.open();
+
+ if (selectedFileName != null) {
+ if(!selectedFileName.endsWith(Messages.EXTENSION_P2F.substring(1)))
+ selectedFileName += Messages.EXTENSION_P2F.substring(1);
+ setDestinationValue(selectedFileName);
+ }
+ }
+
+ public void handleEvent(Event event) {
+ Widget source = event.widget;
+
+ if (source == destinationBrowseButton) {
+ handleDestinationBrowseButtonPressed();
+ }
+ }
+
+ protected void initializeService() {
+ ServiceTracker<P2ImportExport, P2ImportExport> tracker = new ServiceTracker<P2ImportExport, P2ImportExport>(Platform.getBundle(Constants.Bundle_ID).getBundleContext(),
+ P2ImportExport.class.getName(), null);
+ tracker.open();
+ importexportService = tracker.getService();
+ tracker.close();
+ }
+
+ protected void setDestinationValue(String selectedFileName) {
+ destinationNameField.setText(selectedFileName);
+ }
+
+ /**
+ * Determine if the page is complete and update the page appropriately.
+ */
+ protected void updatePageCompletion() {
+ boolean pageComplete = determinePageCompletion();
+ setPageComplete(pageComplete);
+ if (pageComplete) {
+ setMessage(null);
+ }
+ }
+
+ /**
+ * Validate the destination group.
+ * @return <code>true</code> if the group is valid. If
+ * not set the error message and return <code>false</code>.
+ */
+ protected boolean validateDestinationGroup() {
+ if (!validDestination()) {
+ currentMessage = getInvalidDestinationMessage();
+ return false;
+ }
+
+ return true;
+ }
+
+ protected boolean validateOptionsGroup() {
+ if(viewer == null || viewer.getCheckedElements().length > 0)
+ return true;
+
+ currentMessage = getNoOptionsMessage();
+ return false;
+ }
+
+ protected boolean validDestination() {
+ if (this.destinationNameField == null)
+ return true;
+ File file = new File(getDestinationValue());
+ return !(file.getPath().length() <= 0 || file.isDirectory());
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractWizard.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractWizard.java
new file mode 100755
index 000000000..2f7ed00be
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/AbstractWizard.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.internal.p2.importexport.internal.Constants;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+
+public abstract class AbstractWizard extends Wizard {
+
+ protected AbstractPage mainPage = null;
+
+ public AbstractWizard() {
+ super();
+ }
+
+ @Override
+ public boolean performFinish() {
+ try {
+ mainPage.doFinish();
+ } catch (Exception e) {
+ Platform.getLog(Platform.getBundle(Constants.Bundle_ID)).log(
+ new Status(IStatus.ERROR, Constants.Bundle_ID, e.getMessage(), e));
+ MessageBox messageBox = new MessageBox(this.getShell(), SWT.ICON_ERROR);
+ messageBox.setMessage(e.getMessage() == null ? "Unknown error" : e.getMessage()); //$NON-NLS-1$
+ messageBox.open();
+ return false;
+ }
+ return true;
+ }
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java
new file mode 100755
index 000000000..ed6ed86f2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportPage.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
+import org.eclipse.equinox.internal.p2.ui.model.ProfileElement;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+
+public class ExportPage extends AbstractPage {
+
+ public ExportPage(String pageName) {
+ super(pageName);
+ setTitle(Messages.ExportPage_Title);
+ setDescription(Messages.ExportPage_Description);
+ }
+
+ @Override
+ protected void createContents(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+ if(getSelfProfile() == null){
+ label.setText(Messages.ExportPage_ERROR_CONFIG);
+ }else {
+ label.setText(Messages.ExportPage_Label);
+
+ createInstallationTable(composite);
+ createDestinationGroup(composite);
+ }
+ }
+
+ @Override
+ public void doFinish() throws Exception {
+ finishException = null;
+ if(viewer == null)
+ return;
+ final Object[] checked = viewer.getCheckedElements();
+ OutputStream stream = null;
+ try {
+ File target = new File(ExportPage.this.destinationNameField.getText());
+ if(!target.exists())
+ target.createNewFile();
+ stream = new BufferedOutputStream(new FileOutputStream(target));
+ final OutputStream out = stream;
+ getContainer().run(true, true, new IRunnableWithProgress() {
+
+ public void run(IProgressMonitor monitor) throws InvocationTargetException,
+ InterruptedException {
+ try {
+ IInstallableUnit[] units = new IInstallableUnit[checked.length];
+ for(int i = 0; i < units.length; i++)
+ units[i] = ProvUI.getAdapter(checked[i], IInstallableUnit.class);
+ IStatus status = importexportService.exportP2F(out, units, monitor);
+ if (status.isMultiStatus()) {
+ final StringBuilder sb = new StringBuilder();
+ boolean info = true;
+ for (IStatus child : status.getChildren()) {
+ if (child.isMultiStatus()) {
+ for (IStatus grandchild : child.getChildren())
+ sb.append(grandchild.getMessage()).append("\n"); //$NON-NLS-1$
+ } else if (child.isOK())
+ sb.insert(0, Messages.ExportPage_SuccessWithProblems);
+ else {
+ info = false;
+ sb.insert(0, Messages.ExportPage_Fail);
+ sb.append(status.getMessage());
+ }
+ }
+ final boolean isInfo = info;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ String title = Messages.ExportPage_Title;
+ if (isInfo == true)
+ MessageDialog.openInformation(getShell(), title, sb.toString());
+ else
+ MessageDialog.openWarning(getShell(), title, sb.toString());
+ }
+ });
+ }
+ } catch (OperationCanceledException e) {
+ throw new InterruptedException(e.getMessage());
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ // do nothing for cancelled by users
+ } finally {
+ if(stream != null) {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ // do nothing
+ }
+ }
+ if(finishException != null)
+ throw finishException;
+ }
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.ExportPage_FILEDIALOG_TITLE;
+ }
+
+ @Override
+ protected Object getInput() {
+ // return importexportService.getRootIUs();
+ ProfileElement element = new ProfileElement(null, getSelfProfile().getProfileId());
+ return element;
+ }
+
+
+ @Override
+ protected String getInvalidDestinationMessage() {
+ return Messages.ExportPage_DEST_ERRORMESSAGE;
+ }
+
+ @Override
+ protected void giveFocusToDestination() {
+ if(viewer != null)
+ viewer.getControl().setFocus();
+ }
+
+ @Override
+ protected String getDestinationLabel() {
+ return Messages.ExportPage_LABEL_EXPORTFILE;
+ }
+
+ @Override
+ protected int getBrowseDialogStyle() {
+ return SWT.SAVE;
+ }
+
+ @Override
+ public void handleEvent(Event event) {
+ super.handleEvent(event);
+
+ updatePageCompletion();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportWizard.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportWizard.java
new file mode 100755
index 000000000..0a75c19f0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ExportWizard.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.equinox.internal.p2.importexport.internal.Constants;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IExportWizard;
+import org.eclipse.ui.IWorkbench;
+
+
+public class ExportWizard extends AbstractWizard implements IExportWizard {
+
+ public ExportWizard() {
+ }
+
+ @Override
+ public void addPages() {
+ super.addPages();
+ mainPage = new ExportPage("mainPage"); //$NON-NLS-1$
+ addPage(mainPage);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ setWindowTitle(Messages.ExportWizard_WizardTitle);
+ setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(Platform.getBundle(Constants.Bundle_ID).getEntry("icons/install_wiz.gif"))); //$NON-NLS-1$
+ setNeedsProgressMonitor(true);
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java
new file mode 100644
index 000000000..0322b2e43
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationPage.java
@@ -0,0 +1,368 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationArtifactRepositoryFactory;
+import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepositoryFactory;
+import org.eclipse.equinox.internal.p2.importexport.internal.Constants;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
+import org.eclipse.equinox.internal.p2.ui.dialogs.ISelectableIUsPage;
+import org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard;
+import org.eclipse.equinox.internal.p2.ui.model.ProfileElement;
+import org.eclipse.equinox.internal.p2.ui.viewers.IUDetailsLabelProvider;
+import org.eclipse.equinox.p2.core.IAgentLocation;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.core.IProvisioningAgentProvider;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.IProfileRegistry;
+import org.eclipse.equinox.p2.engine.ProvisioningContext;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
+import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactRepositoryFactory;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
+import org.eclipse.equinox.p2.repository.metadata.spi.MetadataRepositoryFactory;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class ImportFromInstallationPage extends AbstractImportPage implements ISelectableIUsPage {
+
+ protected IProvisioningAgent otherInstanceAgent = null;
+ private File instancePath = null;
+ private URI[] metaURIs = null;
+ private URI[] artiURIs = null;
+ private IProvisioningAgentProvider agentProvider;
+
+ public ImportFromInstallationPage(ProvisioningUI ui, ProvisioningOperationWizard wizard) {
+ super("importfrominstancepage", ui, wizard); //$NON-NLS-1$
+ setTitle(Messages.ImportFromInstallationPage_DIALOG_TITLE);
+ setDescription(Messages.ImportFromInstallationPage_DIALOG_DESCRIPTION);
+ }
+
+ @Override
+ protected void createContents(Composite composite) {
+ createDestinationGroup(composite);
+ createInstallationTable(composite);
+ }
+
+ @Override
+ protected String getDestinationLabel() {
+ return Messages.ImportFromInstallationPage_DESTINATION_LABEL;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.ImportFromInstallationPage_DIALOG_TITLE;
+ }
+
+ @Override
+ protected Object getInput() {
+ return new IInstallableUnit[0];
+ }
+
+ @Override
+ protected String getInvalidDestinationMessage() {
+ return Messages.ImportFromInstallationPage_INVALID_DESTINATION;
+ }
+
+ @Override
+ protected String getNoOptionsMessage() {
+ return Messages.ImportFromInstallationPage_SELECT_COMPONENT;
+ }
+
+ @Override
+ public void handleEvent(Event event) {
+ super.handleEvent(event);
+ if(event.widget == viewer.getControl())
+ updatePageCompletion();
+ }
+
+ @Override
+ protected boolean validateDestinationGroup() {
+ return validateDestinationGroup(new NullProgressMonitor());
+ }
+
+ private IProvisioningAgentProvider getAgentProvider() {
+ if (agentProvider == null) {
+ ServiceTracker<IProvisioningAgentProvider, IProvisioningAgentProvider> tracker =
+ new ServiceTracker<IProvisioningAgentProvider, IProvisioningAgentProvider>(
+ Platform.getBundle(Constants.Bundle_ID).getBundleContext(), IProvisioningAgentProvider.class, null);
+ tracker.open();
+ agentProvider = tracker.getService();
+ tracker.close();
+ }
+ return agentProvider;
+ }
+
+ private boolean validateDestinationGroup(IProgressMonitor monitor) {
+ SubMonitor progress = SubMonitor.convert(monitor, 100);
+
+ boolean rt;
+ if (Display.findDisplay(Thread.currentThread()) == null) {
+ Callable<Boolean> getSuperValidateDest = new Callable<Boolean>() {
+ Boolean validated;
+ public Boolean call() throws Exception {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ validated = ImportFromInstallationPage.super.validateDestinationGroup();
+ }
+ });
+ return validated;
+ }
+ };
+ ExecutorService executor = Executors.newSingleThreadScheduledExecutor();
+ Future<Boolean> getSuperDestTask = executor.submit(getSuperValidateDest);
+
+ try {
+ rt = getSuperDestTask.get().booleanValue();
+ } catch (Exception e) {
+ return false;
+ } finally {
+ executor.shutdown();
+ }
+ } else
+ rt = super.validateDestinationGroup();
+
+ if (rt) {
+ try {
+ String destinate;
+ if (Display.findDisplay(Thread.currentThread()) == null) {
+ Callable<String> getDestinationValue = new Callable<String>() {
+ String destination;
+ public String call() throws Exception {
+ if (Display.findDisplay(Thread.currentThread()) == null) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ destination = getDestinationValue();
+ }
+ });
+ } else
+ destination = getDestinationValue();
+ return destination;
+ }
+ };
+ ExecutorService executor = Executors.newSingleThreadScheduledExecutor();
+ Future<String> getDestTask = executor.submit(getDestinationValue);
+ try {
+ destinate = getDestTask.get();
+ } finally {
+ executor.shutdown();
+ }
+ } else
+ destinate = getDestinationValue();
+ try {
+ File p2 = new File(destinate, "p2"); //$NON-NLS-1$
+ if (p2.exists()) {
+ boolean createAgent = true;
+ if (otherInstanceAgent != null) {
+ // don't create agent again if the selection is not changed
+ if (!p2.equals(instancePath)) {
+ otherInstanceAgent.stop();
+ otherInstanceAgent = null;
+ // update cached specified path by users
+ instancePath = p2;
+ cleanLocalRepository();
+ } else
+ createAgent = false;
+ }
+ if (createAgent)
+ otherInstanceAgent = getAgentProvider().createAgent(p2.toURI());
+ ArtifactRepositoryFactory factory = new ExtensionLocationArtifactRepositoryFactory();
+ factory.setAgent(agent);
+ IArtifactRepository artiRepo = factory.load(new File(destinate).toURI(), 0, progress.newChild(50));
+ artiURIs = new URI[] {artiRepo.getLocation()};
+ MetadataRepositoryFactory metaFatory = new ExtensionLocationMetadataRepositoryFactory();
+ metaFatory.setAgent(agent);
+ IMetadataRepository metaRepo = metaFatory.load(new File(destinate).toURI(), 0, progress.newChild(50));
+ metaURIs = new URI[] {metaRepo.getLocation()};
+
+ } else
+ throw new FileNotFoundException();
+ } catch (ProvisionException e) {
+ if (otherInstanceAgent != null) {
+ IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
+ IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
+ IProfile profile = ((IProfileRegistry)otherInstanceAgent.getService(IProfileRegistry.SERVICE_NAME)).getProfiles()[0];
+ IAgentLocation location = (IAgentLocation) otherInstanceAgent.getService(IAgentLocation.SERVICE_NAME);
+ URI engineDataArea = location.getDataArea("org.eclipse.equinox.p2.engine"); //$NON-NLS-1$
+ progress.setWorkRemaining(50);
+ IMetadataRepository metaRepo = manager.loadRepository(engineDataArea.resolve("profileRegistry/" + profile.getProfileId() + ".profile"), progress.newChild(25)); //$NON-NLS-1$//$NON-NLS-2$
+ metaURIs = new URI[] {metaRepo.getLocation()};
+ IArtifactRepository artiRepo = artifactManager.loadRepository(new File(destinate).toURI(), progress.newChild(25));
+ artiURIs = new URI[] {artiRepo.getLocation()};
+ } else
+ throw new Exception();
+ }
+ } catch (Exception e) {
+ currentMessage = getInvalidDestinationMessage();
+ rt = false;
+ if (otherInstanceAgent != null)
+ otherInstanceAgent.stop();
+ otherInstanceAgent = null;
+ cleanLocalRepository();
+ } finally {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ setErrorMessage(currentMessage);
+ }
+ });
+ monitor.done();
+ }
+ }
+ return rt;
+ }
+
+ @Override
+ protected void giveFocusToDestination() {
+ destinationBrowseButton.setFocus();
+ }
+
+ @Override
+ protected void handleDestinationBrowseButtonPressed() {
+ DirectoryDialog dialog = new DirectoryDialog(getContainer().getShell());
+ dialog.setText(getDialogTitle());
+ dialog.setFilterPath(getDestinationValue());
+ final String selectedFileName = dialog.open();
+
+ if (selectedFileName != null) {
+ setDestinationValue(selectedFileName);
+ try {
+ getContainer().run(true, false, new IRunnableWithProgress() {
+
+ public void run(IProgressMonitor monitor) throws InvocationTargetException,
+ InterruptedException {
+ if (validateDestinationGroup(monitor)) {
+ IProfileRegistry registry = (IProfileRegistry) otherInstanceAgent.getService(IProfileRegistry.SERVICE_NAME);
+ final IProfile profile = registry.getProfiles()[0];
+ final ProfileElement element = new ProfileElement(null, profile.getProfileId()) {
+ @Override
+ public org.eclipse.equinox.p2.query.IQueryable<?> getQueryable() {
+ return profile;
+ };
+ };
+ element.setQueryable(profile);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ viewer.setInput(element);
+ }
+ });
+ }
+ }
+ });
+ } catch (InvocationTargetException e) {
+ setErrorMessage(e.getLocalizedMessage());
+ } catch (InterruptedException e) {
+
+ }
+ }
+ }
+
+ @Override
+ protected boolean validDestination() {
+ if (this.destinationNameField == null)
+ return true;
+ File file = new File(getDestinationValue());
+ return file.exists() && file.isDirectory();
+ }
+
+ class ImportFromInstallationLabelProvider extends IUDetailsLabelProvider {
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ String text = super.getColumnText(element, columnIndex);
+ // it's the order of label provider
+ if (columnIndex == 0) {
+ IInstallableUnit iu = ProvUI.getAdapter(element, IInstallableUnit.class);
+ return getIUNameWithDetail(iu);
+ }
+ return text;
+ }
+
+ @Override
+ public Color getForeground(Object element) {
+ IInstallableUnit iu = ProvUI.getAdapter(element, IInstallableUnit.class);
+ if (hasInstalled(iu))
+ return Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
+ return super.getForeground(element);
+ }
+ }
+
+ @Override
+ protected ITableLabelProvider getLabelProvider() {
+ return new ImportFromInstallationLabelProvider();
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (otherInstanceAgent != null) {
+ otherInstanceAgent.stop();
+ otherInstanceAgent = null;
+ }
+ if (getWizard().performCancel())
+ cleanLocalRepository();
+ }
+
+ public void cleanLocalRepository() {
+ if (metaURIs != null && metaURIs.length > 0) {
+ IProvisioningAgent agent = getProvisioningUI().getSession().getProvisioningAgent();
+ IMetadataRepositoryManager manager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
+ for (URI uri : metaURIs)
+ manager.removeRepository(uri);
+ IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
+ for (URI uri : artiURIs)
+ artifactManager.removeRepository(uri);
+ }
+ }
+
+ public Object[] getCheckedIUElements() {
+ return viewer.getCheckedElements();
+ }
+
+ public Object[] getSelectedIUElements() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setCheckedElements(Object[] elements) {
+ new UnsupportedOperationException();
+ }
+
+ public ProvisioningContext getProvisioningContext() {
+ ProvisioningContext context = new ProvisioningContext(getProvisioningUI().getSession().getProvisioningAgent());
+ context.setArtifactRepositories(artiURIs);
+ context.setMetadataRepositories(metaURIs);
+ return context;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationWizard.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationWizard.java
new file mode 100644
index 000000000..6f8b27d92
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportFromInstallationWizard.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import java.util.Collection;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.equinox.internal.p2.importexport.internal.Constants;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.equinox.internal.p2.ui.dialogs.ISelectableIUsPage;
+import org.eclipse.equinox.internal.p2.ui.dialogs.InstallWizard;
+import org.eclipse.equinox.internal.p2.ui.model.IUElementListRoot;
+import org.eclipse.equinox.p2.engine.ProvisioningContext;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.operations.InstallOperation;
+import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+
+public class ImportFromInstallationWizard extends InstallWizard implements IImportWizard {
+
+ public ImportFromInstallationWizard() {
+ this(ProvisioningUI.getDefaultUI(), null, null, null);
+ }
+
+ public ImportFromInstallationWizard(ProvisioningUI ui, InstallOperation operation, Collection<IInstallableUnit> initialSelections, LoadMetadataRepositoryJob preloadJob) {
+ super(ui, operation, initialSelections, preloadJob);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ setWindowTitle(Messages.ImportWizard_WINDOWTITLE);
+ setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(Platform.getBundle(Constants.Bundle_ID).getEntry("icons/install_wiz.gif"))); //$NON-NLS-1$
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ protected ISelectableIUsPage createMainPage(IUElementListRoot input,
+ Object[] selections) {
+ return new ImportFromInstallationPage(ui, this);
+ }
+
+ @Override
+ protected ProvisioningContext getProvisioningContext() {
+ return ((ImportFromInstallationPage) mainPage).getProvisioningContext();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java
new file mode 100644
index 000000000..0f4139dc0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java
@@ -0,0 +1,365 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.equinox.internal.p2.importexport.IUDetail;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
+import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
+import org.eclipse.equinox.internal.p2.ui.dialogs.ISelectableIUsPage;
+import org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.engine.ProvisioningContext;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.VersionRange;
+import org.eclipse.equinox.p2.query.CompoundQueryable;
+import org.eclipse.equinox.p2.query.QueryUtil;
+import org.eclipse.equinox.p2.repository.IRepository;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+
+public class ImportPage extends AbstractImportPage implements ISelectableIUsPage {
+
+ private class InstallationContentProvider implements IStructuredContentProvider {
+
+ public void dispose() {
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return (Object[])inputElement;
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ }
+
+ private class InstallationLabelProvider extends LabelProvider implements ITableLabelProvider, IColorProvider{
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ IInstallableUnit iu = ((IUDetail) element).getIU();
+ switch (columnIndex) {
+ case 0:
+ return getIUNameWithDetail(iu);
+ case 1:
+ return iu.getVersion().toString();
+ case 2:
+ return iu.getId();
+ default:
+ throw new RuntimeException("Should not happen"); //$NON-NLS-1$
+ }
+
+ }
+
+ public Color getForeground(Object element) {
+ if (hasInstalled(ProvUI.getAdapter(element, IInstallableUnit.class)))
+ return Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+ }
+
+ private List<IUDetail> features;
+ private final List<URI> loadRepos = new ArrayList<URI>();
+ private final Map<IUDetail, IUDetail[]> newProposedFeature = new HashMap<IUDetail, IUDetail[]>();
+ private Button contactAll;
+ private Button installLatest;
+
+ public ImportPage(ProvisioningUI ui, ProvisioningOperationWizard wizard) {
+ super("importpage", ui, wizard); //$NON-NLS-1$
+ setTitle(Messages.ImportPage_TITLE);
+ setDescription(Messages.ImportPage_DESCRIPTION);
+ }
+
+ @Override
+ protected void createContents(Composite composite) {
+ createDestinationGroup(composite);
+ createInstallationTable(composite);
+ createAdditionOptions(composite);
+ }
+
+ private void createAdditionOptions(Composite parent) {
+ Composite composite = new Composite(parent, SWT.BORDER);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(
+ GridData.FILL, GridData.FILL, true, false));
+
+ contactAll = new Button(composite, SWT.CHECK);
+ contactAll.setText(ProvUIMessages.AvailableIUsPage_ResolveAllCheckbox);
+
+ installLatest = new Button(composite, SWT.CHECK);
+ installLatest.setText(Messages.ImportPage_InstallLatestVersion);
+ installLatest.setSelection(true);
+ }
+
+ @Override
+ protected IContentProvider getContentProvider() {
+ return new InstallationContentProvider();
+ }
+
+ @Override
+ protected ITableLabelProvider getLabelProvider() {
+ return new InstallationLabelProvider();
+ }
+
+ @Override
+ protected int getBrowseDialogStyle() {
+ return SWT.OPEN;
+ }
+
+ @Override
+ protected String getDestinationLabel() {
+ return Messages.ImportPage_DESTINATION_LABEL;
+ }
+
+ @Override
+ protected String getDialogTitle() {
+ return Messages.ImportPage_FILEDIALOG_TITLE;
+ }
+
+ @Override
+ protected IUDetail[] getInput() {
+ return new IUDetail[0];
+ }
+
+ @Override
+ protected String getInvalidDestinationMessage() {
+ return Messages.ImportPage_DEST_ERROR;
+ }
+
+ @Override
+ protected void giveFocusToDestination() {
+ destinationNameField.setFocus();
+ }
+
+ @Override
+ public void handleEvent(Event event) {
+ super.handleEvent(event);
+ updatePageCompletion();
+ }
+
+ @Override
+ protected void updatePageCompletion() {
+ super.updatePageCompletion();
+ if (isPageComplete())
+ getProvisioningWizard().operationSelectionsChanged(this);
+ }
+
+ @Override
+ protected void setDestinationValue(String selectedFileName) {
+ String oldValue = getDestinationValue();
+ super.setDestinationValue(selectedFileName);
+ if(validateDestinationGroup()) {
+ // p2f file is changed, update the cached data
+ if (!selectedFileName.equals(oldValue)) {
+ loadRepos.clear();
+ newProposedFeature.clear();
+ }
+ InputStream input = null;
+ try{
+ input = new BufferedInputStream(new FileInputStream(getDestinationValue()));
+ features = importexportService.importP2F(input);
+ viewer.setInput(features.toArray(new IUDetail[features.size()]));
+ input.close();
+ } catch (FileNotFoundException e) {
+ MessageDialog.openError(getShell(), Messages.ImportPage_TITLE, Messages.ImportPage_FILENOTFOUND);
+ } catch(IOException e) {
+ //TODO
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ protected boolean validDestination() {
+ File target = new File(getDestinationValue());
+ return super.validDestination() && target.exists() && target.canRead();
+ }
+
+ public Object[] getCheckedIUElements() {
+ Object[] checked = viewer.getCheckedElements();
+ List<IUDetail> features = new ArrayList<IUDetail>(checked.length);
+ for (int i = 0; i < checked.length; i++) {
+ IUDetail feature = (IUDetail) checked[i];
+ IUDetail[] existingFeatures = newProposedFeature.get(feature);
+ if (existingFeatures == null)
+ features.add(feature);
+ else {
+ IUDetail matchPolicy = null;
+ for (IUDetail f : existingFeatures) {
+ if (matchPolicy == null)
+ matchPolicy = f;
+ // here use exact match
+ else if (matchPolicy.getIU().getVersion().compareTo(f.getIU().getVersion()) < 0) {
+ if (installLatest.getSelection())
+ matchPolicy = f;
+ else
+ continue;
+ }
+ else
+ matchPolicy = f;
+ }
+ if (matchPolicy != null)
+ features.add(matchPolicy);
+ }
+ }
+ return features.toArray(new IUDetail[features.size()]);
+ }
+
+ public Object[] getSelectedIUElements() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setCheckedElements(Object[] elements) {
+ new UnsupportedOperationException();
+ }
+
+ public ProvisioningContext getProvisioningContext() {
+ if (agent != null) {
+ Object[] checked = viewer.getCheckedElements();
+ List<URI> referredRepos = new ArrayList<URI>(checked.length);
+ for (Object checkItem : checked) {
+ IUDetail feature = (IUDetail) checkItem;
+ for (URI uri : feature.getReferencedRepositories()) {
+ referredRepos.add(uri);
+ }
+ }
+ ProvisioningContext context = new ProvisioningContext(agent);
+ if (!contactAll.getSelection()) {
+ context.setArtifactRepositories(referredRepos.toArray(new URI[referredRepos.size()]));
+ context.setMetadataRepositories(referredRepos.toArray(new URI[referredRepos.size()]));
+ }
+ return context;
+ }
+ return null;
+ }
+
+ public boolean hasUnloadedRepo() {
+ for (Object checked : viewer.getCheckedElements()) {
+ IUDetail feature = (IUDetail) checked;
+ for (URI uri : feature.getReferencedRepositories())
+ if (!loadRepos.contains(uri))
+ return true;
+ }
+ return false;
+ }
+
+ class GetCheckedElement implements Runnable {
+ Object[] checkedElements = null;
+ public void run() {
+ checkedElements = viewer.getCheckedElements();
+ }
+ }
+
+ public Object[] getChecked() {
+ if (Display.findDisplay(Thread.currentThread()) != null)
+ return viewer.getCheckedElements();
+ else {
+ GetCheckedElement get = new GetCheckedElement();
+ Display.getDefault().syncExec(get);
+ return get.checkedElements;
+ }
+ }
+
+ public void recompute(IProgressMonitor monitor) throws InterruptedException {
+ SubMonitor sub = SubMonitor.convert(monitor, Messages.ImportPage_QueryFeaturesJob, 1000);
+ if (agent != null) {
+ IMetadataRepositoryManager metaManager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
+ IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
+ Object[] checked = getChecked();
+ sub.setWorkRemaining(100 * checked.length);
+ for (Object item : checked) {
+ IUDetail feature = (IUDetail) item;
+ if (!newProposedFeature.containsKey(feature)) {
+ if (sub.isCanceled())
+ throw new InterruptedException();
+ SubMonitor sub2 = sub.newChild(100, SubMonitor.SUPPRESS_ALL_LABELS);
+ sub2.setWorkRemaining(feature.getReferencedRepositories().size() * 500 + 100);
+ List<IRepository<IInstallableUnit>> repos = new ArrayList<IRepository<IInstallableUnit>>();
+ for (URI uri : feature.getReferencedRepositories()) {
+ if (!metaManager.contains(uri)) {
+ metaManager.addRepository(uri);
+ }
+ metaManager.setEnabled(uri, true);
+ try {
+ repos.add(metaManager.loadRepository(uri, sub2.newChild(500)));
+ } catch (ProvisionException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (OperationCanceledException e) {
+ throw new InterruptedException(e.getLocalizedMessage());
+ }
+ if (!artifactManager.contains(uri)) {
+ artifactManager.addRepository(uri);
+ }
+ artifactManager.setEnabled(uri, true);
+ }
+ if (sub2.isCanceled())
+ throw new InterruptedException();
+ Set<IInstallableUnit> result = new CompoundQueryable<IInstallableUnit>(repos.toArray(new IRepository[repos.size()])).query(
+ QueryUtil.createIUQuery(feature.getIU().getId(), new VersionRange(feature.getIU().getVersion(), true, null, false)), sub2.newChild(100)).toSet();
+ List<IUDetail> existingFeatures = new ArrayList<IUDetail>(result.size());
+ for (IInstallableUnit iu : result) {
+ existingFeatures.add(new IUDetail(iu, feature.getReferencedRepositories()));
+ }
+ newProposedFeature.put(feature, existingFeatures.toArray(new IUDetail[existingFeatures.size()]));
+ } else {
+ if (sub.isCanceled())
+ throw new InterruptedException();
+ sub.worked(100);
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java
new file mode 100644
index 000000000..b8012081d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.internal.wizard;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.equinox.internal.p2.importexport.internal.Constants;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.equinox.internal.p2.ui.ProvUI;
+import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
+import org.eclipse.equinox.internal.p2.ui.dialogs.ISelectableIUsPage;
+import org.eclipse.equinox.internal.p2.ui.dialogs.InstallWizard;
+import org.eclipse.equinox.internal.p2.ui.model.IUElementListRoot;
+import org.eclipse.equinox.p2.engine.ProvisioningContext;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.operations.InstallOperation;
+import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.statushandlers.StatusManager;
+
+public class ImportWizard extends InstallWizard implements IImportWizard {
+
+ public ImportWizard() {
+ this(ProvisioningUI.getDefaultUI(), null, null, null);
+ }
+
+ public ImportWizard(ProvisioningUI ui, InstallOperation operation, Collection<IInstallableUnit> initialSelections, LoadMetadataRepositoryJob preloadJob) {
+ super(ui, operation, initialSelections, preloadJob);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ setWindowTitle(Messages.ImportWizard_WINDOWTITLE);
+ setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(Platform.getBundle(Constants.Bundle_ID).getEntry("icons/install_wiz.gif"))); //$NON-NLS-1$
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ protected ISelectableIUsPage createMainPage(IUElementListRoot input,
+ Object[] selections) {
+ return new ImportPage(ui, this);
+ }
+
+ @Override
+ protected ProvisioningContext getProvisioningContext() {
+ return ((ImportPage) mainPage).getProvisioningContext();
+ }
+
+ /**
+ * Recompute the provisioning plan based on the items in the IUElementListRoot and the given provisioning context.
+ * Report progress using the specified runnable context. This method may be called before the page is created.
+ *
+ * @param runnableContext
+ */
+ @Override
+ public void recomputePlan(IRunnableContext runnableContext) {
+ if (((ImportPage) mainPage).hasUnloadedRepo()) {
+ try {
+ runnableContext.run(true, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InterruptedException {
+ SubMonitor sub = SubMonitor.convert(monitor, 1000);
+ ((ImportPage) mainPage).recompute(sub.newChild(800));
+ if (sub.isCanceled())
+ throw new InterruptedException();
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ ProvisioningContext context = getProvisioningContext();
+ initializeResolutionModelElements(getOperationSelections());
+ if (planSelections.length == 0) {
+ operation = null;
+ couldNotResolve(ProvUIMessages.ResolutionWizardPage_NoSelections);
+ } else {
+ operation = getProfileChangeOperation(planSelections);
+ operation.setProvisioningContext(context);
+ }
+ }
+ });
+ if (sub.isCanceled())
+ throw new InterruptedException();
+ operation.resolveModal(sub.newChild(200));
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ planChanged();
+ }
+ });
+ }
+ });
+ } catch (InterruptedException e) {
+ // Nothing to report if thread was interrupted
+ } catch (InvocationTargetException e) {
+ ProvUI.handleException(e.getCause(), null, StatusManager.SHOW | StatusManager.LOG);
+ couldNotResolve(null);
+ }
+ } else
+ super.recomputePlan(runnableContext);
+ }
+
+ void couldNotResolve(String message) {
+ IStatus couldNotResolveStatus;
+ if (message != null) {
+ couldNotResolveStatus = new Status(IStatus.ERROR, Constants.Bundle_ID, message, null);
+ } else {
+ couldNotResolveStatus = new Status(IStatus.ERROR, Constants.Bundle_ID, ProvUIMessages.ProvisioningOperationWizard_UnexpectedFailureToResolve, null);
+ }
+ StatusManager.getManager().handle(couldNotResolveStatus, StatusManager.LOG);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FConstants.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FConstants.java
new file mode 100644
index 000000000..295414db2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FConstants.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.persistence;
+
+import org.eclipse.equinox.p2.metadata.Version;
+
+public interface P2FConstants {
+
+ public static final Version CURRENT_VERSION = Version.createOSGi(1, 0, 0);
+
+ public static final String P2F_ELEMENT = "p2f"; //$NON-NLS-1$
+ public static final String IUS_ELEMENT = "ius"; //$NON-NLS-1$
+ public static final String IU_ELEMENT = "iu"; //$NON-NLS-1$
+
+ public static final String REPOSITORIES_ELEMENT = "repositories"; //$NON-NLS-1$
+ public static final String REPOSITORY_ELEMENT = "repository"; //$NON-NLS-1$
+ public static final String P2FURI_ATTRIBUTE = "uri"; //$NON-NLS-1$
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java
new file mode 100644
index 000000000..13935b22d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java
@@ -0,0 +1,237 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.persistence;
+
+import java.io.*;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.equinox.internal.p2.importexport.IUDetail;
+import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
+import org.eclipse.equinox.internal.p2.persistence.XMLParser;
+import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.osgi.util.NLS;
+import org.osgi.framework.BundleContext;
+import org.xml.sax.*;
+
+public class P2FParser extends XMLParser implements P2FConstants {
+
+ static final VersionRange XML_TOLERANCE = new VersionRange(CURRENT_VERSION, true, Version.createOSGi(2, 0, 0), false);
+ private List<IUDetail> features;
+
+ protected class RepositoryHandler extends AbstractHandler {
+
+ private final String[] required = new String[] {LOCATION_ELEMENT};
+ private final String[] optional = new String[] {};
+ private URI referredRepo;
+ private List<URI> uri;
+
+ public RepositoryHandler(AbstractHandler parentHandler, Attributes attributes, List<URI> uri) {
+ super(parentHandler, REPOSITORY_ELEMENT);
+ String[] values = parseAttributes(attributes, required, optional);
+ //skip entire subrepository if the location is missing
+ if (values[0] == null)
+ return;
+ this.uri = uri;
+ referredRepo = checkURI(REPOSITORY_ELEMENT, LOCATION_ELEMENT, values[0]);
+ }
+
+ @Override
+ public void startElement(String name, Attributes attributes) throws SAXException {
+ checkCancel();
+ }
+
+ @Override
+ protected void finished() {
+ if (referredRepo != null)
+ uri.add(referredRepo);
+ }
+ }
+
+ protected class RepositoriesHandler extends AbstractHandler {
+
+ List<URI> uris;
+
+ public RepositoriesHandler(AbstractHandler parentHandler, Attributes attributes) {
+ super(parentHandler, REPOSITORIES_ELEMENT);
+ String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE);
+ uris = (size == null) ? new ArrayList<URI>() : new ArrayList<URI>(new Integer(size).intValue());
+ }
+
+ @Override
+ public void startElement(String name, Attributes attributes) throws SAXException {
+ if (name.equals(REPOSITORY_ELEMENT)) {
+ new RepositoryHandler(this, attributes, uris);
+ }
+ }
+
+ public List<URI> getRepositories() {
+ return uris;
+ }
+ }
+
+ protected class FeatureHandler extends AbstractHandler {
+ private final String[] required = new String[] {ID_ATTRIBUTE, NAME_ATTRIBUTE, VERSION_ATTRIBUTE};
+ private final String[] optional = new String[] {};
+
+ IInstallableUnit iu = null;
+ private RepositoriesHandler repositoriesHandler;
+ private List<IUDetail> features;
+
+ public FeatureHandler(AbstractHandler parentHandler, Attributes attributes, List<IUDetail> features) {
+ super(parentHandler, IU_ELEMENT);
+ String[] values = parseAttributes(attributes, required, optional);
+ //skip entire record if the id is missing
+ if (values[0] == null)
+ return;
+ MetadataFactory.InstallableUnitDescription desc = new MetadataFactory.InstallableUnitDescription();
+ desc.setId(values[0]);
+ desc.setProperty(IInstallableUnit.PROP_NAME, values[1]);
+ desc.setVersion(Version.create(values[2]));
+ iu = MetadataFactory.createInstallableUnit(desc);
+ this.features = features;
+ }
+
+ @Override
+ public void startElement(String name, Attributes attributes) {
+ if (name.equals(REPOSITORIES_ELEMENT)) {
+ repositoriesHandler = new RepositoriesHandler(this, attributes);
+ }
+ }
+
+ @Override
+ protected void finished() {
+ if (isValidXML()) {
+ IUDetail feature = new IUDetail(iu, repositoriesHandler.getRepositories());
+ features.add(feature);
+ }
+ }
+ }
+
+ protected class FeaturesHanlder extends AbstractHandler {
+
+ private final List<IUDetail> features;
+
+ public FeaturesHanlder(ContentHandler parentHandler, Attributes attributes) {
+ super(parentHandler, IUS_ELEMENT);
+ String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE);
+ features = (size != null ? new ArrayList<IUDetail>(new Integer(size).intValue()) : new ArrayList<IUDetail>());
+ }
+
+ @Override
+ public void startElement(String name, Attributes attributes) {
+ if (name.equals(IU_ELEMENT)) {
+ new FeatureHandler(this, attributes, features);
+ } else {
+ invalidElement(name, attributes);
+ }
+ }
+
+ public List<IUDetail> getFeatureDetails() {
+ return features;
+ }
+ }
+
+ private final class P2FDocHandler extends DocHandler {
+
+ public P2FDocHandler(String rootName, RootHandler rootHandler) {
+ super(rootName, rootHandler);
+ }
+
+ @Override
+ public void processingInstruction(String target, String data) throws SAXException {
+ Version repositoryVersion = extractPIVersion(target, data);
+ if (!XML_TOLERANCE.isIncluded(repositoryVersion)) {
+ throw new SAXException(NLS.bind(Messages.io_IncompatibleVersion, repositoryVersion, XML_TOLERANCE));
+ }
+ }
+ }
+
+ private final class P2FHandler extends RootHandler {
+ private final String[] required = new String[] {VERSION_ATTRIBUTE};
+ private final String[] optional = new String[] {};
+ private String[] attrValues = new String[required.length + optional.length];
+
+ private FeaturesHanlder featuresHanlder;
+
+ @Override
+ protected void handleRootAttributes(Attributes attributes) {
+ attrValues = parseAttributes(attributes, required, optional);
+ attrValues[0] = checkVersion(P2F_ELEMENT, VERSION_ATTRIBUTE, attrValues[0]).toString();
+ }
+
+ @Override
+ public void startElement(String name, Attributes attributes) throws SAXException {
+ if (IUS_ELEMENT.equals(name)) {
+ if (featuresHanlder == null) {
+ featuresHanlder = new FeaturesHanlder(this, attributes);
+ } else {
+ duplicateElement(this, name, attributes);
+ }
+ } else {
+ invalidElement(name, attributes);
+ }
+ }
+
+ @Override
+ protected void finished() {
+ if (isValidXML()) {
+ features = featuresHanlder.getFeatureDetails();
+ }
+ }
+ }
+
+ public P2FParser(BundleContext context, String pluginId) {
+ super(context, pluginId);
+ }
+
+ public void parse(File file) throws IOException {
+ // don't overwrite if we already have a filename/location
+ if (errorContext == null)
+ setErrorContext(file.getAbsolutePath());
+ parse(new FileInputStream(file));
+ }
+
+ public synchronized void parse(InputStream stream) throws IOException {
+ this.status = null;
+ try {
+ // TODO: currently not caching the parser since we make no assumptions
+ // or restrictions on concurrent parsing
+ getParser();
+ P2FHandler p2fHandler = new P2FHandler();
+ xmlReader.setContentHandler(new P2FDocHandler(P2F_ELEMENT, p2fHandler));
+ xmlReader.parse(new InputSource(stream));
+ } catch (SAXException e) {
+ throw new IOException(e.getMessage());
+ } catch (ParserConfigurationException e) {
+ throw new IOException(e.getMessage());
+ } finally {
+ stream.close();
+ }
+ }
+
+ public List<IUDetail> getFeatures() {
+ return features;
+ }
+
+ @Override
+ protected Object getRootObject() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected String getErrorMessage() {
+ return Messages.io_parseError;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FWriter.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FWriter.java
new file mode 100755
index 000000000..13c5dc69e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FWriter.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport.persistence;
+
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.util.List;
+import java.util.Locale;
+import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.equinox.internal.p2.importexport.IUDetail;
+import org.eclipse.equinox.internal.p2.persistence.XMLWriter;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+
+public class P2FWriter extends XMLWriter implements P2FConstants {
+
+ public P2FWriter(OutputStream output, ProcessingInstruction[] piElements) throws UnsupportedEncodingException {
+ super(output, piElements);
+ }
+
+ public void write(List<IUDetail> features) {
+ start(P2F_ELEMENT);
+ attribute(VERSION_ATTRIBUTE, CURRENT_VERSION);
+ writeFeatures(features);
+ end(P2F_ELEMENT);
+ flush();
+ }
+
+ private void writeFeatures(List<IUDetail> features) {
+ start(IUS_ELEMENT);
+ attributeOptional(COLLECTION_SIZE_ATTRIBUTE, String.valueOf(features.size()));
+ for (IUDetail feature : features)
+ writeFeature(feature);
+ end(IUS_ELEMENT);
+ }
+
+ private void writeFeature(IUDetail feature) {
+ IInstallableUnit unit = feature.getIU();
+ start(IU_ELEMENT);
+ attribute(ID_ATTRIBUTE, unit.getId());
+ attribute(NAME_ATTRIBUTE, unit.getProperty(IInstallableUnit.PROP_NAME, Locale.getDefault().toString()));
+ attribute(VERSION_ATTRIBUTE, unit.getVersion().toString());
+ start(REPOSITORIES_ELEMENT);
+ attribute(COLLECTION_SIZE_ATTRIBUTE, feature.getReferencedRepositories().size());
+ for (URI uri : feature.getReferencedRepositories()) {
+ start(REPOSITORY_ELEMENT);
+ String unencoded = URIUtil.toUnencodedString(uri);
+ attribute(LOCATION_ELEMENT, unencoded);
+ end(REPOSITORY_ELEMENT);
+ }
+ end(REPOSITORIES_ELEMENT);
+ end(IU_ELEMENT);
+ }
+}

Back to the top