Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-02-16 18:50:31 -0500
committerspingel2010-02-16 18:50:31 -0500
commit04bf644b7baa6f90dc9259bae309bec9a764226d (patch)
treed33c03c3def7dfb24ea8c125dfd070730b8732b9 /bundles/org.eclipse.equinox.p2.discovery
parent28e7440a4d694780df7ee7606a570a74a35ede7c (diff)
downloadrt.equinox.p2-04bf644b7baa6f90dc9259bae309bec9a764226d.tar.gz
rt.equinox.p2-04bf644b7baa6f90dc9259bae309bec9a764226d.tar.xz
rt.equinox.p2-04bf644b7baa6f90dc9259bae309bec9a764226d.zip
bug 295273 - [discovery] move Mylyn Connector Discovery UI into P2
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.discovery')
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.classpath11
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.cvsignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.gitignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.project34
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.jdt.core.prefs342
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.jdt.ui.prefs63
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.pde.prefs24
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/META-INF/MANIFEST.MF13
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/build.properties17
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/plugin.properties13
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/AbstractCatalogSource.java45
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/AbstractDiscoveryStrategy.java79
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Catalog.java334
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/DiscoveryCore.java41
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Messages.java45
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Policy.java42
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/messages.properties17
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/AbstractCatalogItem.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/CatalogCategory.java153
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/CatalogItem.java369
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Certification.java102
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/FeatureFilter.java69
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Group.java51
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Icon.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Messages.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Overview.java85
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Tag.java106
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/ValidationException.java31
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/messages.properties23
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/util/CatalogCategoryComparator.java51
-rw-r--r--bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/util/CatalogItemComparator.java74
35 files changed, 2433 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.discovery/.classpath b/bundles/org.eclipse.equinox.p2.discovery/.classpath
new file mode 100644
index 000000000..93640193e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.classpath
@@ -0,0 +1,11 @@
+<?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">
+ <accessrules>
+ <accessrule kind="accessible" pattern="org/eclipse/equinox/internal/p2/core/**"/>
+ </accessrules>
+ </classpathentry>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.discovery/.cvsignore b/bundles/org.eclipse.equinox.p2.discovery/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/bundles/org.eclipse.equinox.p2.discovery/.gitignore b/bundles/org.eclipse.equinox.p2.discovery/.gitignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.gitignore
@@ -0,0 +1 @@
+bin
diff --git a/bundles/org.eclipse.equinox.p2.discovery/.project b/bundles/org.eclipse.equinox.p2.discovery/.project
new file mode 100644
index 000000000..997b422bf
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.p2.discovery</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.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.discovery/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..1314ffa2f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,342 @@
+#Tue May 12 20:42:46 PDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+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.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=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+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=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+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.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+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=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+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=80
+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=1
+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=false
+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=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_comments=true
+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=true
+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=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+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=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+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=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=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=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=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not 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.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+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=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+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=true
+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
diff --git a/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..4cbefa939
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,63 @@
+#Tue May 12 20:42:43 PDT 2009
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Mylyn based on Eclipse
+formatter_settings_version=11
+internal.default.compliance=default
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\n * Copyright (c) 2010 Tasktop Technologies and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * Tasktop Technologies - initial API and implementation\n *******************************************************************************/\n\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ignore\n${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ignore</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></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_methods=false
+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=true
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+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=true
+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=true
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+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=true
+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=true
+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.discovery/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644
index 000000000..ec06d1d86
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.ltk.core.refactoring.prefs
@@ -0,0 +1,3 @@
+#Tue Feb 16 15:42:45 PST 2010
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.mylyn.tasks.ui.prefs b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 000000000..d8c6d26af
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Mon Jun 25 03:02:37 GMT 2007
+eclipse.preferences.version=1
+project.repository.kind=bugzilla
+project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.mylyn.team.ui.prefs b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 000000000..1935f1ab0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Tue Feb 16 15:42:45 PST 2010
+commit.comment.template=${connector.task.prefix} ${task.key} - ${task.description}
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.pde.prefs
new file mode 100644
index 000000000..5937a85ac
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,24 @@
+#Tue May 20 17:39:22 PDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=2
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-bundle-classpath-entries=1
+compilers.p.missing-packages=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.equinox.p2.discovery/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.discovery/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..a4d03cd75
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.equinox.p2.discovery;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %Bundle-Vendor
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.3.0",
+ org.eclipse.equinox.p2.core;bundle-version="2.0.0"
+Export-Package: org.eclipse.equinox.internal.p2.discovery;x-friends:="org.eclipse.equinox.p2.discovery.compatiblity,org.eclipse.equinox.p2.ui.discovery,org.eclipse.equinox.p2.discovery.repository",
+ org.eclipse.equinox.internal.p2.discovery.model;x-friends:="org.eclipse.equinox.p2.discovery.compatiblity,org.eclipse.equinox.p2.ui.discovery,org.eclipse.equinox.p2.discovery.repository",
+ org.eclipse.equinox.internal.p2.discovery.util;x-friends:="org.eclipse.equinox.p2.discovery.compatiblity,org.eclipse.equinox.p2.ui.discovery,org.eclipse.equinox.p2.discovery.repository"
+Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.equinox.p2.discovery/about.html b/bundles/org.eclipse.equinox.p2.discovery/about.html
new file mode 100644
index 000000000..bc6e2b493
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>July 3, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
+
+
+</body>
+</html>
diff --git a/bundles/org.eclipse.equinox.p2.discovery/build.properties b/bundles/org.eclipse.equinox.p2.discovery/build.properties
new file mode 100644
index 000000000..40577979b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2009 Tasktop Technologies 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:
+# Tasktop Technologies - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties
+src.includes = about.html \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.discovery/plugin.properties b/bundles/org.eclipse.equinox.p2.discovery/plugin.properties
new file mode 100644
index 000000000..38b4c3f0d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/plugin.properties
@@ -0,0 +1,13 @@
+###############################################################################
+# Copyright (c) 2009 Tasktop Technologies 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:
+# Tasktop Technologies - initial API and implementation
+###############################################################################
+extension-point.name = Connector Discovery
+Bundle-Vendor = Eclipse.org - Equinox
+Bundle-Name = Equinox Provisioning Discovery \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/AbstractCatalogSource.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/AbstractCatalogSource.java
new file mode 100644
index 000000000..49bc9d9de
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/AbstractCatalogSource.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery;
+
+import java.net.URL;
+
+
+/**
+ * @author David Green
+ */
+public abstract class AbstractCatalogSource {
+
+ private Policy policy = Policy.defaultPolicy();
+
+ /**
+ * an identifier that can be used to determine the origin of the source, typically for logging purposes.
+ */
+ public abstract Object getId();
+
+ /**
+ * get a resource by an URL relative to the root of the source.
+ *
+ * @param relativeUrl
+ * the relative resource name
+ * @return an URL to the resource, or null if it is known that the resource does not exist.
+ */
+ public abstract URL getResource(String resourceName);
+
+ public Policy getPolicy() {
+ return policy;
+ }
+
+ public void setPolicy(Policy policy) {
+ this.policy = policy;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/AbstractDiscoveryStrategy.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/AbstractDiscoveryStrategy.java
new file mode 100644
index 000000000..6ea71cd57
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/AbstractDiscoveryStrategy.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.equinox.internal.p2.discovery.model.CatalogCategory;
+import org.eclipse.equinox.internal.p2.discovery.model.CatalogItem;
+import org.eclipse.equinox.internal.p2.discovery.model.Certification;
+import org.eclipse.equinox.internal.p2.discovery.model.Tag;
+
+/**
+ * An abstraction of a strategy for discovering connectors and categories. Strategy design pattern. Note that strategies
+ * are not reusable and must be disposed.
+ *
+ * @author David Green
+ * @author Steffen Pingel
+ */
+public abstract class AbstractDiscoveryStrategy {
+
+ protected List<CatalogCategory> categories;
+
+ protected List<Certification> certifications;
+
+ protected List<CatalogItem> items;
+
+ protected List<Tag> tags;
+
+ public void dispose() {
+ }
+
+ public List<CatalogCategory> getCategories() {
+ return categories;
+ }
+
+ public List<Certification> getCertifications() {
+ return certifications;
+ }
+
+ public List<CatalogItem> getItems() {
+ return items;
+ }
+
+ public List<Tag> getTags() {
+ return tags;
+ }
+
+ /**
+ * Perform discovery and add discovered items to {@link #getCategories() categories} and {@link #getItems()}.
+ */
+ public abstract void performDiscovery(IProgressMonitor monitor) throws CoreException;
+
+ public void setCategories(List<CatalogCategory> categories) {
+ this.categories = categories;
+ }
+
+ public void setCertifications(List<Certification> certifications) {
+ this.certifications = certifications;
+ }
+
+ public void setItems(List<CatalogItem> connectors) {
+ this.items = connectors;
+ }
+
+ public void setTags(List<Tag> itemKinds) {
+ this.tags = itemKinds;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Catalog.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Catalog.java
new file mode 100644
index 000000000..c95dad39c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Catalog.java
@@ -0,0 +1,334 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IBundleGroup;
+import org.eclipse.core.runtime.IBundleGroupProvider;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
+import org.eclipse.equinox.internal.p2.discovery.model.AbstractCatalogItem;
+import org.eclipse.equinox.internal.p2.discovery.model.CatalogCategory;
+import org.eclipse.equinox.internal.p2.discovery.model.CatalogItem;
+import org.eclipse.equinox.internal.p2.discovery.model.Certification;
+import org.eclipse.equinox.internal.p2.discovery.model.FeatureFilter;
+import org.eclipse.equinox.internal.p2.discovery.model.Tag;
+import org.eclipse.osgi.service.resolver.VersionRange;
+import org.eclipse.osgi.util.NLS;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.Version;
+
+/**
+ * A means of discovering connectors.
+ *
+ * @author David Green
+ */
+public class Catalog {
+
+ private List<CatalogItem> items = Collections.emptyList();
+
+ private List<CatalogCategory> categories = Collections.emptyList();
+
+ private List<Certification> certifications = Collections.emptyList();
+
+ private List<CatalogItem> filteredItems = Collections.emptyList();
+
+ private final List<AbstractDiscoveryStrategy> discoveryStrategies = new ArrayList<AbstractDiscoveryStrategy>();
+
+ private List<Tag> tags = Collections.emptyList();
+
+ private Dictionary<Object, Object> environment = System.getProperties();
+
+ private boolean verifyUpdateSiteAvailability = false;
+
+ private Map<String, Version> featureToVersion = null;
+
+ public Catalog() {
+ }
+
+ /**
+ * get the discovery strategies to use.
+ */
+ public List<AbstractDiscoveryStrategy> getDiscoveryStrategies() {
+ return discoveryStrategies;
+ }
+
+ /**
+ * Initialize this by performing discovery. Discovery may take a long time as it involves network access.
+ * PRECONDITION: must add at least one {@link #getDiscoveryStrategies() discovery strategy} prior to calling.
+ *
+ * @return
+ */
+ public IStatus performDiscovery(IProgressMonitor monitor) {
+ MultiStatus status = new MultiStatus(DiscoveryCore.ID_PLUGIN, 0,
+ Messages.Catalog_Failed_to_discovery_all_Error, null);
+ if (discoveryStrategies.isEmpty()) {
+ throw new IllegalStateException();
+ }
+ items = new ArrayList<CatalogItem>();
+ filteredItems = new ArrayList<CatalogItem>();
+ categories = new ArrayList<CatalogCategory>();
+ certifications = new ArrayList<Certification>();
+
+ final int totalTicks = 100000;
+ final int discoveryTicks = totalTicks - (totalTicks / 10);
+ monitor.beginTask(Messages.Catalog_task_discovering_connectors, totalTicks);
+ try {
+ for (AbstractDiscoveryStrategy discoveryStrategy : discoveryStrategies) {
+ discoveryStrategy.setCategories(categories);
+ discoveryStrategy.setItems(items);
+ discoveryStrategy.setCertifications(certifications);
+ discoveryStrategy.setTags(tags);
+ try {
+ discoveryStrategy.performDiscovery(new SubProgressMonitor(monitor, discoveryTicks
+ / discoveryStrategies.size()));
+ } catch (CoreException e) {
+ status.add(new Status(IStatus.ERROR, DiscoveryCore.ID_PLUGIN, NLS.bind(
+ Messages.Catalog_Strategy_failed_Error, discoveryStrategy.getClass().getSimpleName()), e));
+ }
+ }
+
+ filterDescriptors();
+ connectCategoriesToDescriptors();
+ connectCertificationsToDescriptors();
+ } finally {
+ monitor.done();
+ }
+ return status;
+ }
+
+ /**
+ * get the top-level categories
+ *
+ * @return the categories, or an empty list if there are none.
+ */
+ public List<CatalogCategory> getCategories() {
+ return categories;
+ }
+
+ /**
+ * get the connectors that were discovered and not filtered
+ *
+ * @return the connectors, or an empty list if there are none.
+ */
+ public List<CatalogItem> getItems() {
+ return items;
+ }
+
+ public List<Tag> getTags() {
+ return tags;
+ }
+
+ /**
+ * get the connectors that were discovered but filtered
+ *
+ * @return the filtered connectors, or an empty list if there were none.
+ */
+ public List<CatalogItem> getFilteredItems() {
+ return filteredItems;
+ }
+
+ /**
+ * The environment used to resolve {@link AbstractCatalogItem#getPlatformFilter() platform filters}. Defaults to the
+ * current environment.
+ */
+ public Dictionary<Object, Object> getEnvironment() {
+ return environment;
+ }
+
+ /**
+ * The environment used to resolve {@link AbstractCatalogItem#getPlatformFilter() platform filters}. Defaults to the
+ * current environment.
+ */
+ public void setEnvironment(Dictionary<Object, Object> environment) {
+ if (environment == null) {
+ throw new IllegalArgumentException();
+ }
+ this.environment = environment;
+ }
+
+ /**
+ * indicate if update site availability should be verified. The default is false.
+ *
+ * @see CatalogItem#getAvailable()
+ * @see #verifySiteAvailability(IProgressMonitor)
+ */
+ public boolean isVerifyUpdateSiteAvailability() {
+ return verifyUpdateSiteAvailability;
+ }
+
+ /**
+ * indicate if update site availability should be verified. The default is false.
+ *
+ * @see CatalogItem#getAvailable()
+ * @see #verifySiteAvailability(IProgressMonitor)
+ */
+ public void setVerifyUpdateSiteAvailability(boolean verifyUpdateSiteAvailability) {
+ this.verifyUpdateSiteAvailability = verifyUpdateSiteAvailability;
+ }
+
+ /**
+ * <em>not for general use: public for testing purposes only</em> A map of installed features to their version. Used
+ * to resolve {@link AbstractCatalogItem#getFeatureFilter() feature filters}.
+ */
+ public Map<String, Version> getFeatureToVersion() {
+ return featureToVersion;
+ }
+
+ /**
+ * <em>not for general use: public for testing purposes only</em> A map of installed features to their version. Used
+ * to resolve {@link AbstractCatalogItem#getFeatureFilter() feature filters}.
+ */
+ public void setFeatureToVersion(Map<String, Version> featureToVersion) {
+ this.featureToVersion = featureToVersion;
+ }
+
+ private void connectCertificationsToDescriptors() {
+ Map<String, Certification> idToCertification = new HashMap<String, Certification>();
+ for (Certification certification : certifications) {
+ Certification previous = idToCertification.put(certification.getId(), certification);
+ if (previous != null) {
+ LogHelper.log(new Status(IStatus.ERROR, DiscoveryCore.ID_PLUGIN, NLS.bind(
+ "Duplicate certification id ''{0}'': declaring sources: {1}, {2}", //$NON-NLS-1$
+ new Object[] { certification.getId(), certification.getSource().getId(),
+ previous.getSource().getId() })));
+ }
+ }
+
+ for (CatalogItem connector : items) {
+ if (connector.getCertificationId() != null) {
+ Certification certification = idToCertification.get(connector.getCertificationId());
+ if (certification != null) {
+ connector.setCertification(certification);
+ } else {
+ LogHelper.log(new Status(IStatus.ERROR, DiscoveryCore.ID_PLUGIN, NLS.bind(
+ "Unknown category ''{0}'' referenced by connector ''{1}'' declared in {2}", new Object[] { //$NON-NLS-1$
+ connector.getCertificationId(), connector.getId(), connector.getSource().getId() })));
+ }
+ }
+ }
+ }
+
+ private void connectCategoriesToDescriptors() {
+ Map<String, CatalogCategory> idToCategory = new HashMap<String, CatalogCategory>();
+ for (CatalogCategory category : categories) {
+ CatalogCategory previous = idToCategory.put(category.getId(), category);
+ if (previous != null) {
+ LogHelper.log(new Status(IStatus.ERROR, DiscoveryCore.ID_PLUGIN, NLS.bind(
+ Messages.Catalog_duplicate_category_id, new Object[] { category.getId(),
+ category.getSource().getId(), previous.getSource().getId() })));
+ }
+ }
+
+ for (CatalogItem connector : items) {
+ CatalogCategory category = idToCategory.get(connector.getCategoryId());
+ if (category != null) {
+ category.getItems().add(connector);
+ connector.setCategory(category);
+ } else {
+ LogHelper.log(new Status(IStatus.ERROR, DiscoveryCore.ID_PLUGIN, NLS.bind(
+ Messages.Catalog_bundle_references_unknown_category, new Object[] { connector.getCategoryId(),
+ connector.getId(), connector.getSource().getId() })));
+ }
+ }
+ }
+
+ /**
+ * eliminate any connectors whose {@link AbstractCatalogItem#getPlatformFilter() platform filters} don't match
+ */
+ private void filterDescriptors() {
+ for (CatalogItem connector : new ArrayList<CatalogItem>(items)) {
+ if (connector.getPlatformFilter() != null && connector.getPlatformFilter().trim().length() > 0) {
+ boolean match = false;
+ try {
+ Filter filter = FrameworkUtil.createFilter(connector.getPlatformFilter());
+ match = filter.match(environment);
+ } catch (InvalidSyntaxException e) {
+ LogHelper.log(new Status(IStatus.ERROR, DiscoveryCore.ID_PLUGIN, NLS.bind(
+ Messages.Catalog_illegal_filter_syntax, new Object[] { connector.getPlatformFilter(),
+ connector.getId(), connector.getSource().getId() })));
+ }
+ if (!match) {
+ items.remove(connector);
+ filteredItems.add(connector);
+ }
+ }
+ for (FeatureFilter featureFilter : connector.getFeatureFilter()) {
+ if (featureToVersion == null) {
+ featureToVersion = computeFeatureToVersion();
+ }
+ boolean match = false;
+ Version version = featureToVersion.get(featureFilter.getFeatureId());
+ if (version != null) {
+ VersionRange versionRange = new VersionRange(featureFilter.getVersion());
+ if (versionRange.isIncluded(version)) {
+ match = true;
+ }
+ }
+ if (!match) {
+ items.remove(connector);
+ filteredItems.add(connector);
+ break;
+ }
+ }
+ }
+ }
+
+ private Map<String, Version> computeFeatureToVersion() {
+ Map<String, Version> featureToVersion = new HashMap<String, Version>();
+ for (IBundleGroupProvider provider : Platform.getBundleGroupProviders()) {
+ for (IBundleGroup bundleGroup : provider.getBundleGroups()) {
+ for (Bundle bundle : bundleGroup.getBundles()) {
+ featureToVersion.put(bundle.getSymbolicName(), bundle.getVersion());
+ }
+ }
+ }
+ return featureToVersion;
+ }
+
+ public void dispose() {
+ for (final AbstractDiscoveryStrategy strategy : discoveryStrategies) {
+ SafeRunner.run(new ISafeRunnable() {
+
+ public void run() throws Exception {
+ strategy.dispose();
+ }
+
+ public void handleException(Throwable exception) {
+ LogHelper.log(new Status(IStatus.ERROR, DiscoveryCore.ID_PLUGIN,
+ Messages.Catalog_exception_disposing + strategy.getClass().getName(), exception));
+ }
+ });
+ }
+ }
+
+ public void setTags(List<Tag> tags) {
+ this.tags = new ArrayList<Tag>(tags);
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/DiscoveryCore.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/DiscoveryCore.java
new file mode 100644
index 000000000..bcc6db461
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/DiscoveryCore.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.eclipse.core.runtime.IProduct;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * @author David Green
+ */
+public abstract class DiscoveryCore {
+
+ public static final String ID_PLUGIN = "org.eclipse.equinox.p2.discovery"; //$NON-NLS-1$
+
+ private DiscoveryCore() {
+ }
+
+ public static Dictionary<Object, Object> createEnvironment() {
+ Dictionary<Object, Object> environment = new Hashtable<Object, Object>(System.getProperties());
+ // add the installed Mylyn version to the environment so that we can
+ // have
+ // connectors that are filtered based on version of Mylyn
+ IProduct product = Platform.getProduct();
+ if (product != null) {
+ environment.put("org.eclipse.product.id", product.getId()); //$NON-NLS-1$
+ }
+ return environment;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Messages.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Messages.java
new file mode 100644
index 000000000..a6bbe4fa4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Messages.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.discovery;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author David Green
+ */
+class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.discovery.messages"; //$NON-NLS-1$
+
+ public static String Catalog_bundle_references_unknown_category;
+
+ public static String Catalog_duplicate_category_id;
+
+ public static String Catalog_exception_disposing;
+
+ public static String Catalog_Failed_to_discovery_all_Error;
+
+ public static String Catalog_illegal_filter_syntax;
+
+ public static String Catalog_Strategy_failed_Error;
+
+ public static String Catalog_task_discovering_connectors;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Policy.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Policy.java
new file mode 100644
index 000000000..63b3d64b1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/Policy.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.discovery;
+
+/**
+ * A policy defines what is permitted.
+ *
+ * @author David Green
+ */
+public class Policy {
+
+ /**
+ * Define system property <code>org.eclipse.mylyn.internal.discovery.core.model.Policy.permissive=true</code> to
+ * allow for categories to be permitted by anyone. For testing purposes.
+ */
+ private static final boolean PERMISSIVE = Boolean.getBoolean(Policy.class.getName() + ".permissive"); //$NON-NLS-1$
+
+ private static final Policy DEFAULT = new Policy(false);
+
+ private final boolean permitCategories;
+
+ public Policy(boolean permitCategories) {
+ this.permitCategories = permitCategories;
+ }
+
+ public boolean isPermitCategories() {
+ return permitCategories || PERMISSIVE;
+ }
+
+ public static Policy defaultPolicy() {
+ return DEFAULT;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/messages.properties b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/messages.properties
new file mode 100644
index 000000000..c0f5d077a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/messages.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2009 Tasktop Technologies 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:
+# Tasktop Technologies - initial API and implementation
+###############################################################################
+Catalog_bundle_references_unknown_category=Unknown category ''{0}'' referenced by connector ''{1}'' declared in {2}
+Catalog_duplicate_category_id=Duplicate category id ''{0}'': declaring sources: {1}, {2}
+Catalog_exception_disposing=exception disposing
+Catalog_Failed_to_discovery_all_Error=Failed to discover all connectors.
+Catalog_illegal_filter_syntax=Illegal filter syntax ''{0}'' in connector ''{1}'' declared in {2}
+Catalog_Strategy_failed_Error={0} failed with an error
+Catalog_task_discovering_connectors=Retrieving listing
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/AbstractCatalogItem.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/AbstractCatalogItem.java
new file mode 100644
index 000000000..f70a962ad
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/AbstractCatalogItem.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+/**
+ * @author Steffen Pingel
+ */
+public class AbstractCatalogItem {
+
+ private Object data;
+
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/CatalogCategory.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/CatalogCategory.java
new file mode 100644
index 000000000..cf49711ea
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/CatalogCategory.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.equinox.internal.p2.discovery.AbstractCatalogSource;
+
+/**
+ * @author David Green
+ */
+public class CatalogCategory extends AbstractCatalogItem {
+
+ private AbstractCatalogSource source;
+
+ private final List<CatalogItem> items = new ArrayList<CatalogItem>();
+
+ protected String id;
+
+ protected String name;
+
+ protected String description;
+
+ protected String relevance;
+
+ protected Icon icon;
+
+ protected Overview overview;
+
+ protected java.util.List<Group> group = new java.util.ArrayList<Group>();
+
+ public List<CatalogItem> getItems() {
+ return items;
+ }
+
+ public AbstractCatalogSource getSource() {
+ return source;
+ }
+
+ public void setSource(AbstractCatalogSource source) {
+ this.source = source;
+ }
+
+ /**
+ * an id that uniquely identifies the category
+ */
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * the name of the category, as it is displayed in the ui.
+ */
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * A description of the category
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * A relevance, which is a number from 0 to 100. Categories with higher relevance are displayed with preference in
+ * the UI.
+ */
+ public String getRelevance() {
+ return relevance;
+ }
+
+ public void setRelevance(String relevance) {
+ this.relevance = relevance;
+ }
+
+ public Icon getIcon() {
+ return icon;
+ }
+
+ public void setIcon(Icon icon) {
+ this.icon = icon;
+ }
+
+ public Overview getOverview() {
+ return overview;
+ }
+
+ public void setOverview(Overview overview) {
+ this.overview = overview;
+ }
+
+ public java.util.List<Group> getGroup() {
+ return group;
+ }
+
+ public void setGroup(java.util.List<Group> group) {
+ this.group = group;
+ }
+
+ public void validate() throws ValidationException {
+ if (id == null || id.length() == 0) {
+ throw new ValidationException(Messages.CatalogCategory_must_specify_CatalogCategory_id);
+ }
+ if (name == null || name.length() == 0) {
+ throw new ValidationException(Messages.CatalogCategory_must_specify_CatalogCategory_name);
+ }
+ if (description == null || description.length() == 0) {
+ throw new ValidationException("Must specify connectorCategory/@description"); //$NON-NLS-1$
+ }
+ if (icon != null) {
+ icon.validate();
+ }
+ if (relevance != null) {
+ try {
+ int r = Integer.parseInt(relevance, 10);
+ if (r < 0 || r > 100) {
+ throw new NumberFormatException();
+ }
+ } catch (NumberFormatException e) {
+ throw new ValidationException(Messages.CatalogCategory_CatalogCategory_relevance_invalid);
+ }
+ }
+ if (overview != null) {
+ overview.validate();
+ }
+ for (Group groupItem : group) {
+ groupItem.validate();
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/CatalogItem.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/CatalogItem.java
new file mode 100644
index 000000000..a3738614e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/CatalogItem.java
@@ -0,0 +1,369 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.net.MalformedURLException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.equinox.internal.p2.discovery.AbstractCatalogSource;
+
+/**
+ * @author David Green
+ */
+public class CatalogItem extends AbstractCatalogItem {
+
+ private AbstractCatalogSource source;
+
+ private CatalogCategory category;
+
+ private boolean selected;
+
+ private Boolean available;
+
+ private Certification certification;
+
+ private final PropertyChangeSupport changeSupport;
+
+ private boolean installed;
+
+ private Set<Tag> tags;
+
+ protected String name;
+
+ protected String provider;
+
+ protected String license;
+
+ protected String description;
+
+ protected String siteUrl;
+
+ protected String id;
+
+ protected String categoryId;
+
+ protected String platformFilter;
+
+ protected String groupId;
+
+ protected java.util.List<FeatureFilter> featureFilter = new java.util.ArrayList<FeatureFilter>();
+
+ protected java.util.List<String> installableUnits = new java.util.ArrayList<String>();
+
+ protected Icon icon;
+
+ protected Overview overview;
+
+ protected String certificationId;
+
+ public CatalogItem() {
+ changeSupport = new PropertyChangeSupport(this);
+ }
+
+ public CatalogCategory getCategory() {
+ return category;
+ }
+
+ public void setCategory(CatalogCategory category) {
+ this.category = category;
+ }
+
+ public AbstractCatalogSource getSource() {
+ return source;
+ }
+
+ public void setSource(AbstractCatalogSource source) {
+ this.source = source;
+ }
+
+ public Certification getCertification() {
+ return certification;
+ }
+
+ public void setCertification(Certification certification) {
+ this.certification = certification;
+ }
+
+ /**
+ * support selection
+ *
+ * @return true if the item is selected, otherwise false
+ */
+ public boolean isSelected() {
+ return selected;
+ }
+
+ /**
+ * support selection
+ *
+ * @param selected
+ * true if the item is selected, otherwise false
+ */
+ public void setSelected(boolean selected) {
+ this.selected = selected;
+ }
+
+ /**
+ * indicate if this connector is available
+ *
+ * @return true if available, false if not, or null if availability is unknown
+ */
+ public Boolean getAvailable() {
+ return available;
+ }
+
+ /**
+ * indicate if this connector is available
+ *
+ * @param available
+ * true if available, false if not, or null if availability is unknown
+ */
+ public void setAvailable(Boolean available) {
+ if (available != this.available || (available != null && !available.equals(this.available))) {
+ Boolean previous = this.available;
+ this.available = available;
+ changeSupport.firePropertyChange("available", previous, this.available); //$NON-NLS-1$
+ }
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ changeSupport.addPropertyChangeListener(listener);
+ }
+
+ public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ changeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ changeSupport.removePropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ changeSupport.removePropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * the name of the connector including the name of the organization that produces the repository if appropriate, for
+ * example 'Mozilla Bugzilla'.
+ */
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * The name of the organization that supplies the connector.
+ */
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ /**
+ * The short name of the license, for example 'EPL 1.0', 'GPL 2.0', or 'Commercial'.
+ */
+ public String getLicense() {
+ return license;
+ }
+
+ public void setLicense(String license) {
+ this.license = license;
+ }
+
+ /**
+ * A description of the connector. Plug-ins should provide a description, especially if the description is not
+ * self-evident from the @name and
+ *
+ * @organization.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * The URL of the update site containing the connector.
+ */
+ public String getSiteUrl() {
+ return siteUrl;
+ }
+
+ public void setSiteUrl(String siteUrl) {
+ this.siteUrl = siteUrl;
+ }
+
+ /**
+ * The id of the feature that installs this connector
+ */
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * the id of the connectorCategory in which this connector belongs
+ */
+ public String getCategoryId() {
+ return categoryId;
+ }
+
+ public void setCategoryId(String categoryId) {
+ this.categoryId = categoryId;
+ }
+
+ public String getCertificationId() {
+ return certificationId;
+ }
+
+ public void setCertificationId(String certificationId) {
+ this.certificationId = certificationId;
+ }
+
+ /**
+ * E.g., "(& (osgi.os=macosx) (osgi.ws=carbon))"
+ */
+ public String getPlatformFilter() {
+ return platformFilter;
+ }
+
+ public void setPlatformFilter(String platformFilter) {
+ this.platformFilter = platformFilter;
+ }
+
+ /**
+ * The id of the connectorCategory group. See group/@id for more details.
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public java.util.List<FeatureFilter> getFeatureFilter() {
+ return featureFilter;
+ }
+
+ public void setFeatureFilter(java.util.List<FeatureFilter> featureFilter) {
+ this.featureFilter = featureFilter;
+ }
+
+ public Icon getIcon() {
+ return icon;
+ }
+
+ public void setIcon(Icon icon) {
+ this.icon = icon;
+ }
+
+ public Overview getOverview() {
+ return overview;
+ }
+
+ public void setOverview(Overview overview) {
+ this.overview = overview;
+ }
+
+ public void validate() throws ValidationException {
+ if (name == null || name.length() == 0) {
+ throw new ValidationException(Messages.CatalogItem_must_specify_CatalogItem_name);
+ }
+ if (provider == null || provider.length() == 0) {
+ throw new ValidationException(Messages.CatalogItem_must_specify_CatalogItem_provider);
+ }
+ if (license == null || license.length() == 0) {
+ throw new ValidationException(Messages.CatalogItem_must_specify_CatalogItem_license);
+ }
+ if (siteUrl == null || siteUrl.length() == 0) {
+ throw new ValidationException(Messages.CatalogItem_must_specify_CatalogItem_siteUrl);
+ }
+ try {
+ new java.net.URL(siteUrl);
+ } catch (MalformedURLException e) {
+ throw new ValidationException(Messages.CatalogItem_invalid_CatalogItem_siteUrl);
+ }
+ if (id == null || id.length() == 0) {
+ throw new ValidationException(Messages.CatalogItem_must_specify_CatalogItem_id);
+ }
+ if (categoryId == null || categoryId.length() == 0) {
+ throw new ValidationException(Messages.CatalogItem_must_specify_CatalogItem_categoryId);
+ }
+ for (FeatureFilter featureFilterItem : featureFilter) {
+ featureFilterItem.validate();
+ }
+ if (icon != null) {
+ icon.validate();
+ }
+ if (overview != null) {
+ overview.validate();
+ }
+ }
+
+ public java.util.List<String> getInstallableUnits() {
+ return installableUnits;
+ }
+
+ public void setInstallableUnits(java.util.List<String> installableUnits) {
+ this.installableUnits = installableUnits;
+ }
+
+ public boolean isInstalled() {
+ return installed;
+ }
+
+ public void setInstalled(boolean installed) {
+ this.installed = installed;
+ }
+
+ public Set<Tag> getTags() {
+ if (tags == null) {
+ return Collections.emptySet();
+ } else {
+ return Collections.unmodifiableSet(tags);
+ }
+ }
+
+ public boolean hasTag(Tag tag) {
+ return tags == null ? false : tags.contains(tag);
+ }
+
+ public void addTag(Tag tag) {
+ if (tags == null) {
+ tags = new HashSet<Tag>();
+ }
+ tags.add(tag);
+ }
+
+ public boolean removeTag(Tag tag) {
+ if (tags == null) {
+ return false;
+ }
+ return tags.remove(tag);
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Certification.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Certification.java
new file mode 100644
index 000000000..4122aa824
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Certification.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+import org.eclipse.equinox.internal.p2.discovery.AbstractCatalogSource;
+
+/**
+ * @author Steffen Pingel
+ */
+public class Certification {
+
+ private AbstractCatalogSource source;
+
+ protected String id;
+
+ protected String name;
+
+ protected String description;
+
+ protected Icon icon;
+
+ protected String url;
+
+ public AbstractCatalogSource getSource() {
+ return source;
+ }
+
+ public void setSource(AbstractCatalogSource source) {
+ this.source = source;
+ }
+
+ /**
+ * an id that uniquely identifies the category
+ */
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * the name of the category, as it is displayed in the ui.
+ */
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * A description of the category
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Icon getIcon() {
+ return icon;
+ }
+
+ public void setIcon(Icon icon) {
+ this.icon = icon;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void validate() throws ValidationException {
+ if (id == null || id.length() == 0) {
+ throw new ValidationException(Messages.CatalogCategory_must_specify_CatalogCategory_id);
+ }
+ if (name == null || name.length() == 0) {
+ throw new ValidationException(Messages.CatalogCategory_must_specify_CatalogCategory_name);
+ }
+ if (icon != null) {
+ icon.validate();
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/FeatureFilter.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/FeatureFilter.java
new file mode 100644
index 000000000..4e9d50b05
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/FeatureFilter.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+/**
+ * A means of specifying that a feature must be present in order for the connectorDescriptor to be presented to the
+ * user.
+ *
+ * @author David Green
+ */
+public class FeatureFilter {
+
+ protected String featureId;
+
+ protected String version;
+
+ protected CatalogItem item;
+
+ public FeatureFilter() {
+ }
+
+ /**
+ * The id of the feature to test
+ */
+ public String getFeatureId() {
+ return featureId;
+ }
+
+ public void setFeatureId(String featureId) {
+ this.featureId = featureId;
+ }
+
+ /**
+ * A version specifier, specified in the same manner as version dependencies are specified in an OSGi manifest. For
+ * example: "[3.0,4.0)"
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public CatalogItem getItem() {
+ return item;
+ }
+
+ public void setItem(CatalogItem catalogItem) {
+ this.item = catalogItem;
+ }
+
+ public void validate() throws ValidationException {
+ if (featureId == null || featureId.length() == 0) {
+ throw new ValidationException(Messages.FeatureFilter_must_specify_featureFilter_featureId);
+ }
+ if (version == null || version.length() == 0) {
+ throw new ValidationException(Messages.FeatureFilter_must_specify_featureFilter_version);
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Group.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Group.java
new file mode 100644
index 000000000..d59aa8e38
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Group.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Task top Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+/**
+ * groups provide a way to anchor connectors in a grouping with other like entries.
+ *
+ * @author David Green
+ */
+public class Group {
+
+ protected String id;
+
+ protected CatalogCategory category;
+
+ public Group() {
+ }
+
+ /**
+ * An identifier that identifies the group. Must be unique for a particular connectorCategory.
+ */
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public CatalogCategory getCategory() {
+ return category;
+ }
+
+ public void setCategory(CatalogCategory category) {
+ this.category = category;
+ }
+
+ public void validate() throws ValidationException {
+ if (id == null || id.length() == 0) {
+ throw new ValidationException(Messages.Group_must_specify_group_id);
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Icon.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Icon.java
new file mode 100644
index 000000000..dc3edb6ff
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Icon.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+/**
+ * @author David Green
+ */
+public class Icon {
+
+ protected String image16;
+
+ protected String image32;
+
+ protected String image48;
+
+ protected String image64;
+
+ protected String image128;
+
+ public Icon() {
+ }
+
+ public String getImage16() {
+ return image16;
+ }
+
+ public void setImage16(String image16) {
+ this.image16 = image16;
+ }
+
+ public String getImage32() {
+ return image32;
+ }
+
+ public void setImage32(String image32) {
+ this.image32 = image32;
+ }
+
+ public String getImage48() {
+ return image48;
+ }
+
+ public void setImage48(String image48) {
+ this.image48 = image48;
+ }
+
+ public String getImage64() {
+ return image64;
+ }
+
+ public void setImage64(String image64) {
+ this.image64 = image64;
+ }
+
+ public String getImage128() {
+ return image128;
+ }
+
+ public void setImage128(String image128) {
+ this.image128 = image128;
+ }
+
+ public void validate() throws ValidationException {
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Messages.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Messages.java
new file mode 100644
index 000000000..3446f4e04
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Messages.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author David Green
+ */
+class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.discovery.model.messages"; //$NON-NLS-1$
+
+ public static String CatalogCategory_CatalogCategory_relevance_invalid;
+
+ public static String CatalogCategory_must_specify_CatalogCategory_id;
+
+ public static String CatalogCategory_must_specify_CatalogCategory_name;
+
+ public static String CatalogItem_invalid_CatalogItem_siteUrl;
+
+ public static String CatalogItem_must_specify_CatalogItem_categoryId;
+
+ public static String CatalogItem_must_specify_CatalogItem_id;
+
+ public static String CatalogItem_must_specify_CatalogItem_license;
+
+ public static String CatalogItem_must_specify_CatalogItem_name;
+
+ public static String CatalogItem_must_specify_CatalogItem_provider;
+
+ public static String CatalogItem_must_specify_CatalogItem_siteUrl;
+
+ public static String FeatureFilter_must_specify_featureFilter_featureId;
+
+ public static String FeatureFilter_must_specify_featureFilter_version;
+
+ public static String Group_must_specify_group_id;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Overview.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Overview.java
new file mode 100644
index 000000000..f1ab32c04
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Overview.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+/**
+ * @author David Green
+ */
+public class Overview {
+
+ protected String summary;
+
+ protected String url;
+
+ protected String screenshot;
+
+ protected CatalogItem item;
+
+ protected CatalogCategory category;
+
+ public Overview() {
+ }
+
+ /**
+ * A description providing detailed information about the item. Newlines can be used to format the text into
+ * multiple paragraphs if necessary. Text must fit into an area 320x240, otherwise it will be truncated in the UI.
+ * More lengthy descriptions can be provided on a web page if required, see @url.
+ */
+ public String getSummary() {
+ return summary;
+ }
+
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+
+ /**
+ * An URL that points to a web page with more information relevant to the connector or category.
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * 320x240 PNG, JPEG or GIF
+ */
+ public String getScreenshot() {
+ return screenshot;
+ }
+
+ public void setScreenshot(String screenshot) {
+ this.screenshot = screenshot;
+ }
+
+ public CatalogItem getItem() {
+ return item;
+ }
+
+ public void setItem(CatalogItem item) {
+ this.item = item;
+ }
+
+ public CatalogCategory getCategory() {
+ return category;
+ }
+
+ public void setCategory(CatalogCategory category) {
+ this.category = category;
+ }
+
+ public void validate() throws ValidationException {
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Tag.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Tag.java
new file mode 100644
index 000000000..f4f1f8bc2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/Tag.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+/**
+ * Provides means to tag items in the catalog.
+ *
+ * @author David Green
+ * @author Steffen Pingel
+ */
+public class Tag extends AbstractCatalogItem {
+
+ private final Object classifier;
+
+ private final String value;
+
+ private final String label;
+
+ public Tag(String value, String label) {
+ this(null, value, label);
+ }
+
+ public Tag(Object tagClassifier, String value, String label) {
+ this.classifier = tagClassifier;
+ this.value = value;
+ this.label = label;
+ }
+
+ /**
+ * the classifier, which places the tag in a logical category
+ *
+ * @return the classifier or null if this tag is not in any category
+ */
+ public Object getTagClassifier() {
+ return classifier;
+ }
+
+ /**
+ * Returns the value of the tag, not intended for display.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Returns a short user-visible value that is used by the user to identify the tag.
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ @Override
+ public String toString() {
+ return "Tag [classifier=" + classifier + ", value=" + value + ", label=" + label + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+
+ @Override
+ public int hashCode() {
+ // we don't include the label here
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((classifier == null) ? 0 : classifier.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ // we don't consider the label when comparing equality
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Tag other = (Tag) obj;
+ if (classifier == null) {
+ if (other.classifier != null) {
+ return false;
+ }
+ } else if (!classifier.equals(other.classifier)) {
+ return false;
+ }
+ if (value == null) {
+ if (other.value != null) {
+ return false;
+ }
+ } else if (!value.equals(other.value)) {
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/ValidationException.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/ValidationException.java
new file mode 100644
index 000000000..189970cae
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/ValidationException.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery.model;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.internal.p2.discovery.DiscoveryCore;
+
+/**
+ * Indicate that a validation has occurred on the model.
+ *
+ * @author David Green
+ */
+public class ValidationException extends CoreException {
+
+ private static final long serialVersionUID = -7542361242327905294L;
+
+ public ValidationException(String message) {
+ super(new Status(IStatus.ERROR, DiscoveryCore.ID_PLUGIN, message));
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/messages.properties b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/messages.properties
new file mode 100644
index 000000000..8b0f42857
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/model/messages.properties
@@ -0,0 +1,23 @@
+###############################################################################
+# Copyright (c) 2009 Tasktop Technologies 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:
+# Tasktop Technologies - initial API and implementation
+###############################################################################
+CatalogCategory_CatalogCategory_relevance_invalid=connectorCategory/@relevance must be an integer >= 0 and <= 100
+CatalogCategory_must_specify_CatalogCategory_id=Must specify connectorCategory/@id
+CatalogCategory_must_specify_CatalogCategory_name=Must specify connectorCategory/@name
+CatalogItem_invalid_CatalogItem_siteUrl=Invalid connectorDescriptor/@siteUrl
+CatalogItem_must_specify_CatalogItem_categoryId=Must specify connectorDescriptor/@categoryId
+CatalogItem_must_specify_CatalogItem_id=Must specify connectorDescriptor/@id
+CatalogItem_must_specify_CatalogItem_license=Must specify connectorDescriptor/@license
+CatalogItem_must_specify_CatalogItem_name=Must specify connectorDescriptor/@name
+CatalogItem_must_specify_CatalogItem_provider=Must specify connectorDescriptor/@provider
+CatalogItem_must_specify_CatalogItem_siteUrl=Must specify connectorDescriptor/@siteUrl
+FeatureFilter_must_specify_featureFilter_featureId=Must specify featureFilter/@featureId
+FeatureFilter_must_specify_featureFilter_version=Must specify featureFilter/@version
+Group_must_specify_group_id=Must specify group/@id
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/util/CatalogCategoryComparator.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/util/CatalogCategoryComparator.java
new file mode 100644
index 000000000..14055bd39
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/util/CatalogCategoryComparator.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.discovery.util;
+
+import java.util.Comparator;
+
+import org.eclipse.equinox.internal.p2.discovery.model.CatalogCategory;
+
+/**
+ * A comparator that orders categories by relevance and name.
+ *
+ * @author David Green
+ * @author Steffen Pingel
+ */
+public class CatalogCategoryComparator implements Comparator<CatalogCategory> {
+
+ public int compare(CatalogCategory o1, CatalogCategory o2) {
+ if (o1 == o2) {
+ return 0;
+ }
+ String r1 = o1.getRelevance();
+ String r2 = o2.getRelevance();
+ int i = 0;
+ if (r1 != null && r2 != null) {
+ // don't have to worry about format, since they were already validated
+ // note that higher relevance appears first, thus the reverse order of
+ // the comparison.
+ i = new Integer(r2).compareTo(new Integer(r1));
+ } else if (r1 == null && r2 != null) {
+ return 1;
+ } else if (r2 == null && r1 != null) {
+ return -1;
+ }
+ if (i == 0) {
+ i = o1.getName().compareToIgnoreCase(o2.getName());
+ if (i == 0) {
+ i = o1.getId().compareTo(o2.getId());
+ }
+ }
+ return i;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/util/CatalogItemComparator.java b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/util/CatalogItemComparator.java
new file mode 100644
index 000000000..ffffabe8f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.discovery/src/org/eclipse/equinox/internal/p2/discovery/util/CatalogItemComparator.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.internal.p2.discovery.util;
+
+import java.util.Comparator;
+
+import org.eclipse.equinox.internal.p2.discovery.model.CatalogCategory;
+import org.eclipse.equinox.internal.p2.discovery.model.CatalogItem;
+import org.eclipse.equinox.internal.p2.discovery.model.Group;
+
+/**
+ * A comparator that orders connectors by group and alphabetically by their name.
+ *
+ * @author David Green
+ */
+public class CatalogItemComparator implements Comparator<CatalogItem> {
+
+ /**
+ * compute the index of the group id
+ *
+ * @param groupId
+ * the group id or null
+ * @return the index, or -1 if not found
+ */
+ private int computeGroupIndex(CatalogCategory category, String groupId) {
+ if (groupId != null) {
+ int index = -1;
+ for (Group group : category.getGroup()) {
+ ++index;
+ if (group.getId().equals(groupId)) {
+ return index;
+ }
+ }
+ }
+ return -1;
+ }
+
+ public int compare(CatalogItem o1, CatalogItem o2) {
+ if (o1.getCategory() != o2.getCategory()) {
+ throw new IllegalArgumentException();
+ }
+ if (o1 == o2) {
+ return 0;
+ }
+ int g1 = computeGroupIndex(o1.getCategory(), o1.getGroupId());
+ int g2 = computeGroupIndex(o2.getCategory(), o2.getGroupId());
+ int i;
+ if (g1 != g2) {
+ if (g1 == -1) {
+ i = 1;
+ } else if (g2 == -1) {
+ i = -1;
+ } else {
+ i = g1 - g2;
+ }
+ } else {
+ i = o1.getName().compareToIgnoreCase(o2.getName());
+ if (i == 0) {
+ i = o1.getId().compareTo(o2.getId());
+ }
+ }
+ return i;
+ }
+
+}

Back to the top