Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonas2014-09-30 08:27:23 +0000
committerjonas2014-09-30 08:27:23 +0000
commit80533016fda9460092e81753abd0e753ef76c074 (patch)
tree58d34e200b4b767f4ddd3289cf7730e15ec85b09
parentbdf802c790ce2989f5f9e64db0dc0c908f2f7a44 (diff)
downloadorg.eclipse.e4.tools-80533016fda9460092e81753abd0e753ef76c074.tar.gz
org.eclipse.e4.tools-80533016fda9460092e81753abd0e753ef76c074.tar.xz
org.eclipse.e4.tools-80533016fda9460092e81753abd0e753ef76c074.zip
Bug 444692 - Remove WarningsI20140930-2200
Applied proper project specific setting on tools.services and fixed all remaining warnings
-rw-r--r--bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.core.prefs411
-rw-r--r--bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.launching.prefs2
-rw-r--r--bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.ui.prefs115
-rw-r--r--bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.pde.api.tools.prefs97
-rw-r--r--bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.pde.prefs32
-rw-r--r--bundles/org.eclipse.e4.tools.services/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/BasicResourceProvider.java39
-rw-r--r--bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ToolsServicesActivator.java15
-rw-r--r--bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/Messages.java31
-rw-r--r--bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceBundleHelper.java574
-rw-r--r--bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourcePoolFactory.java4
-rw-r--r--bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceService.java117
-rw-r--r--bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/messages.properties2
14 files changed, 1097 insertions, 352 deletions
diff --git a/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000..f548abbf
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+
+encoding//model/etypes.ecore=UTF-8
+
+
+encoding/<project>=UTF-8
diff --git a/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.core.prefs
index c537b630..c9482977 100644
--- a/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,418 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
+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.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+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.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+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=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+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.includeNullInfoFromAsserts=disabled
+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.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=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.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=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.unusedObjectAllocation=ignore
+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.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,HIGH,LOW,LOW,LOW,LOW,LOW,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,PERF,MEM,POLISH,@generated NOT,@ADDED,APITODO
+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_annotation=0
+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_method_declaration=0
+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_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=true
+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=true
+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=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=1
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+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_on_field=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_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=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_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=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_try=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_semicolon_in_try_resources=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_try=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_try=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_semicolon_in_try_resources=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=false
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+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=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=true
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.launching.prefs b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.launching.prefs
new file mode 100644
index 00000000..3bb23527
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.launching.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore
diff --git a/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..791508d1
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,115 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=false
+cleanup.remove_unnecessary_nls_tags=false
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_esmCleanUp
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_esmFormatter
+formatter_settings_version=12
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.javadoc=true
+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">/**\r\n * @return the ${bare_field_name}\r\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">/**\r\n * @param ${param} the ${bare_field_name} to set\r\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">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\r\n * Copyright (c) 2011-${year} EclipseSource Muenchen GmbH and others.\r\n * \r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * ${user} - initial API and implementation\r\n ******************************************************************************/</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><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">/**\r\n * ${tags}\r\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">/**\r\n * {@inheritDoc}\r\n * ${see_to_overridden}\r\n */</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">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\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">\r\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">\r\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">\r\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">\r\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">\t\t\t// TODO Auto-generated catch block\r\n\t\t\t// Do NOT catch all Exceptions ("catch (Exception e)")\r\n\t\t\t// Log AND handle Exceptions if possible \r\n //\r\n // You can just uncomment one of the lines below to log an exception\:\r\n\t\t\t// logException will show the logged excpetion to the user\r\n\t\t\t// ModelUtil.logException(${exception_var});\r\n\t\t\t// ModelUtil.logException("YOUR MESSAGE HERE", ${exception_var});\r\n\t\t\t// logWarning will only add the message to the error log\r\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE", ${exception_var});\r\n\t\t\t// ModelUtil.logWarning("YOUR MESSAGE HERE");\r\n\t\t\t//\t\t\t\r\n\t\t\t// If handling is not possible declare and rethrow Exception</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" 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}\r\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.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></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_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+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=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+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=true
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 00000000..e4e3c007
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,97 @@
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Ignore
+automatically_removed_unused_problem_filters=Disabled
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
diff --git a/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000..0bbee3c4
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.services/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=1
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+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
+eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.e4.tools.services/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.services/META-INF/MANIFEST.MF
index f37cd87b..d583f38b 100644
--- a/bundles/org.eclipse.e4.tools.services/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.tools.services/META-INF/MANIFEST.MF
@@ -4,8 +4,8 @@ Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.e4.tools.services
Bundle-Version: 0.12.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.e4.tools.services,
- org.eclipse.e4.tools.services.impl;x-friends:="org.eclipse.e4.tools.emf.ui"
+Export-Package: org.eclipse.e4.tools.services;version="0.12.0.qualifier",
+ org.eclipse.e4.tools.services.impl;version="0.12.0.qualifier";x-friends:="org.eclipse.e4.tools.emf.ui"
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.swt;bundle-version="3.7.0",
org.eclipse.equinox.common;bundle-version="3.6.0",
diff --git a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/BasicResourceProvider.java b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/BasicResourceProvider.java
index 30944d79..e79a071c 100644
--- a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/BasicResourceProvider.java
+++ b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/BasicResourceProvider.java
@@ -17,50 +17,53 @@ import org.osgi.framework.BundleContext;
public abstract class BasicResourceProvider implements IResourceProviderService {
protected Map<String, String> properties;
protected BundleContext context;
-
+
public void activate(BundleContext context, Map<String, String> properties) {
this.properties = properties;
this.context = context;
}
-
+
+ @Override
public Image getImage(Display display, String key) {
- URL url = FileLocator.find(context.getBundle(),new Path(properties.get(key)),null);
-
- if( url != null ) {
+ final URL url = FileLocator.find(context.getBundle(), new Path(properties.get(key)), null);
+
+ if (url != null) {
InputStream stream = null;
try {
stream = url.openStream();
return new Image(display, stream);
- } catch (Exception e) {
+ } catch (final Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
- if( stream != null ) {
+ if (stream != null) {
try {
stream.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
}
}
}
}
-
+
// TODO Auto-generated method stub
return null;
}
-
+
+ @Override
public Font getFont(Display display, String key) {
return null;
}
+ @Override
public Color getColor(Display display, String key) {
- String color = properties.get(key);
- if (color.startsWith("rgb")) {
- String rgb = color.substring(color.indexOf('(')+1, color.indexOf(')'));
- String[] cols = rgb.split(",");
- int r = Integer.parseInt(cols[0].trim());
- int g = Integer.parseInt(cols[1].trim());
- int b = Integer.parseInt(cols[2].trim());
- return new Color(display, new RGB(r,g,b));
+ final String color = properties.get(key);
+ if (color.startsWith("rgb")) { //$NON-NLS-1$
+ final String rgb = color.substring(color.indexOf('(') + 1, color.indexOf(')'));
+ final String[] cols = rgb.split(","); //$NON-NLS-1$
+ final int r = Integer.parseInt(cols[0].trim());
+ final int g = Integer.parseInt(cols[1].trim());
+ final int b = Integer.parseInt(cols[2].trim());
+ return new Color(display, new RGB(r, g, b));
}
return null;
}
diff --git a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ToolsServicesActivator.java b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ToolsServicesActivator.java
index 04d63672..b9104c4c 100644
--- a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ToolsServicesActivator.java
+++ b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/ToolsServicesActivator.java
@@ -13,6 +13,7 @@ public class ToolsServicesActivator implements BundleActivator {
private BundleContext bundleContext;
private ServiceTracker<PackageAdmin, PackageAdmin> pkgAdminTracker;
private ServiceTracker<LogService, LogService> logTracker;
+ public static final String PLUGIN_ID = "org.eclipse.e4.tools.services"; //$NON-NLS-1$
public ToolsServicesActivator() {
defaultInstance = this;
@@ -22,10 +23,12 @@ public class ToolsServicesActivator implements BundleActivator {
return defaultInstance;
}
+ @Override
public void start(BundleContext context) throws Exception {
bundleContext = context;
}
+ @Override
public void stop(BundleContext context) throws Exception {
if (pkgAdminTracker != null) {
pkgAdminTracker.close();
@@ -40,21 +43,23 @@ public class ToolsServicesActivator implements BundleActivator {
public PackageAdmin getPackageAdmin() {
if (pkgAdminTracker == null) {
- if (bundleContext == null)
+ if (bundleContext == null) {
return null;
+ }
pkgAdminTracker = new ServiceTracker<PackageAdmin, PackageAdmin>(bundleContext,
- PackageAdmin.class, null);
+ PackageAdmin.class, null);
pkgAdminTracker.open();
}
- return (PackageAdmin) pkgAdminTracker.getService();
+ return pkgAdminTracker.getService();
}
public LogService getLogService() {
if (logTracker == null) {
- if (bundleContext == null)
+ if (bundleContext == null) {
return null;
+ }
logTracker = new ServiceTracker<LogService, LogService>(bundleContext,
- LogService.class, null);
+ LogService.class, null);
logTracker.open();
}
return logTracker.getService();
diff --git a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/Messages.java b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/Messages.java
new file mode 100644
index 00000000..149c954b
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/Messages.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH 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:
+ * Jonas - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.e4.tools.services.impl;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Jonas
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.e4.tools.services.impl.messages"; //$NON-NLS-1$
+ public static String ResourceService_NoProvider;
+ public static String ResourceService_PoolDisposed;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceBundleHelper.java b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceBundleHelper.java
index 2201ab5d..4aa8f663 100644
--- a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceBundleHelper.java
+++ b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceBundleHelper.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Dirk Fauth <dirk.fauth@gmail.com> - initial API and implementation
+ * Dirk Fauth <dirk.fauth@gmail.com> - initial API and implementation
******************************************************************************/
package org.eclipse.e4.tools.services.impl;
@@ -34,7 +34,7 @@ import org.osgi.service.packageadmin.PackageAdmin;
/**
* Helper class for retrieving {@link ResourceBundle}s out of OSGi {@link Bundle}s.
- *
+ *
* @author Dirk Fauth
*/
// There is no replacement for PackageAdmin#getBundles()
@@ -61,39 +61,46 @@ public class ResourceBundleHelper {
* The separator character for paths in the platform schema
*/
private static final String PATH_SEPARATOR = "/"; //$NON-NLS-1$
-
+
/**
- * Parses the specified contributor URI and loads the {@link ResourceBundle} for the specified {@link Locale}
- * out of an OSGi {@link Bundle}.
- * <p>Following URIs are supported:
+ * Parses the specified contributor URI and loads the {@link ResourceBundle} for the specified {@link Locale} out of
+ * an OSGi {@link Bundle}.
+ * <p>
+ * Following URIs are supported:
* <ul>
* <li>platform:/[plugin|fragment]/[Bundle-SymbolicName]<br>
* Load the OSGi resource bundle out of the bundle/fragment named [Bundle-SymbolicName]</li>
* <li>platform:/[plugin|fragment]/[Bundle-SymbolicName]/[Path]/[Basename]<br>
- * Load the resource bundle specified by [Path] and [Basename] out of the bundle/fragment named [Bundle-SymbolicName].</li>
+ * Load the resource bundle specified by [Path] and [Basename] out of the bundle/fragment named
+ * [Bundle-SymbolicName].</li>
* <li>bundleclass://[plugin|fragment]/[Full-Qualified-Classname]<br>
- * Instantiate the class specified by [Full-Qualified-Classname] out of the bundle/fragment named [Bundle-SymbolicName].
- * Note that the class needs to be a subtype of {@link ResourceBundle}.</li>
+ * Instantiate the class specified by [Full-Qualified-Classname] out of the bundle/fragment named
+ * [Bundle-SymbolicName]. Note that the class needs to be a subtype of {@link ResourceBundle}.</li>
* </ul>
* </p>
+ *
* @param contributorURI The URI that points to a {@link ResourceBundle}
* @param locale The {@link Locale} to use for loading the {@link ResourceBundle}
* @param localization The service for retrieving a {@link ResourceBundle} for a given {@link Locale} out of
- * the given {@link Bundle} which is specified by URI.
- * @return
+ * the given {@link Bundle} which is specified by URI.
+ * @return the resource bundle
*/
- public static ResourceBundle getResourceBundleForUri(String contributorURI, Locale locale, BundleLocalization localization) {
- if (contributorURI == null)
+ public static ResourceBundle getResourceBundleForUri(String contributorURI, Locale locale,
+ BundleLocalization localization) {
+ if (contributorURI == null) {
return null;
-
- LogService logService = ToolsServicesActivator.getDefault().getLogService();
+ }
+
+ final LogService logService = ToolsServicesActivator.getDefault().getLogService();
URI uri;
try {
uri = new URI(contributorURI);
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
if (logService != null)
+ {
logService.log(LogService.LOG_ERROR, "Invalid contributor URI: " + contributorURI); //$NON-NLS-1$
+ }
return null;
}
@@ -101,15 +108,16 @@ public class ResourceBundleHelper {
Bundle bundle = null;
String resourcePath = null;
String classPath = null;
-
- //the uri follows the platform schema, so we search for .properties files in the bundle
+
+ // the uri follows the platform schema, so we search for .properties files in the bundle
if (PLATFORM_SCHEMA.equals(uri.getScheme())) {
bundleName = uri.getPath();
- if (bundleName.startsWith(PLUGIN_SEGMENT))
+ if (bundleName.startsWith(PLUGIN_SEGMENT)) {
bundleName = bundleName.substring(PLUGIN_SEGMENT.length());
- else if (bundleName.startsWith(FRAGMENT_SEGMENT))
+ } else if (bundleName.startsWith(FRAGMENT_SEGMENT)) {
bundleName = bundleName.substring(FRAGMENT_SEGMENT.length());
-
+ }
+
resourcePath = ""; //$NON-NLS-1$
if (bundleName.contains(PATH_SEPARATOR)) {
resourcePath = bundleName.substring(bundleName.indexOf(PATH_SEPARATOR) + 1);
@@ -118,52 +126,58 @@ public class ResourceBundleHelper {
} else if (BUNDLECLASS_SCHEMA.equals(uri.getScheme())) {
if (uri.getAuthority() == null) {
if (logService != null)
+ {
logService.log(LogService.LOG_ERROR, "Failed to get bundle for: " + contributorURI); //$NON-NLS-1$
+ }
}
bundleName = uri.getAuthority();
- //remove the leading /
+ // remove the leading /
classPath = uri.getPath().substring(1);
}
-
+
ResourceBundle result = null;
if (bundleName != null) {
bundle = getBundleForName(bundleName);
-
+
if (bundle != null) {
if (resourcePath == null && classPath != null) {
- //the URI points to a class within the bundle classpath
- //therefore we are trying to instantiate the class
+ // the URI points to a class within the bundle classpath
+ // therefore we are trying to instantiate the class
try {
- Class<?> resourceBundleClass = bundle.loadClass(classPath);
+ final Class<?> resourceBundleClass = bundle.loadClass(classPath);
result = getEquinoxResourceBundle(classPath, locale, resourceBundleClass.getClassLoader());
- } catch (Exception e) {
+ } catch (final Exception e) {
if (logService != null)
- logService.log(LogService.LOG_ERROR, "Failed to load specified ResourceBundle: " + contributorURI, e); //$NON-NLS-1$
+ {
+ logService.log(LogService.LOG_ERROR,
+ "Failed to load specified ResourceBundle: " + contributorURI, e); //$NON-NLS-1$
+ }
}
}
else if (resourcePath.length() > 0) {
- //the specified URI points to a resource
- //therefore we try to load the .properties files into a ResourceBundle
+ // the specified URI points to a resource
+ // therefore we try to load the .properties files into a ResourceBundle
result = getEquinoxResourceBundle(resourcePath.replace('.', '/'), locale, bundle);
}
else {
- //there is no class and no special resource specified within the URI
- //therefore we load the OSGi resource bundle out of the specified Bundle
- //for the current Locale
+ // there is no class and no special resource specified within the URI
+ // therefore we load the OSGi resource bundle out of the specified Bundle
+ // for the current Locale
result = localization.getLocalization(bundle, locale.toString());
}
}
}
-
+
return result;
}
-
+
/**
- * This method searches for the {@link ResourceBundle} in a modified way by inspecting the configuration option
- * <code>equinox.root.locale</code>.
+ * This method searches for the {@link ResourceBundle} in a modified way by inspecting the configuration option
+ * <code>equinox.root.locale</code>.
* <p>
- * If the value for this system property is set to an empty String the default search order for ResourceBundles is used:
+ * If the value for this system property is set to an empty String the default search order for ResourceBundles is
+ * used:
* <ul>
* <li>bn + Ls + "_" + Cs + "_" + Vs</li>
* <li>bn + Ls + "_" + Cs</li>
@@ -173,8 +187,8 @@ public class ResourceBundleHelper {
* <li>bn + Ld</li>
* <li>bn</li>
* </ul>
- * Where bn is this bundle's localization basename, Ls, Cs and Vs are the specified locale (language, country, variant) and
- * Ld, Cd and Vd are the default locale (language, country, variant).
+ * Where bn is this bundle's localization basename, Ls, Cs and Vs are the specified locale (language, country,
+ * variant) and Ld, Cd and Vd are the default locale (language, country, variant).
* </p>
* <p>
* If Ls equals the value of <code>equinox.root.locale</code> then the following search order is used:
@@ -189,65 +203,67 @@ public class ResourceBundleHelper {
* <li>bn</li>
* </ul>
* </p>
- * If <code>equinox.root.locale=en</code> and en_XX or en is asked for then this allows the root file to be used instead of
+ * If <code>equinox.root.locale=en</code> and en_XX or en is asked for then this allows the root file to be used
+ * instead of
* falling back to the default locale.
- *
- * @param baseName the base name of the resource bundle, a fully qualified class name
- * @param locale the locale for which a resource bundle is desired
- * @param loader the class loader from which to load the resource bundle
- * @return a resource bundle for the given base name and locale
- *
+ *
+ * @param baseName the base name of the resource bundle, a fully qualified class name
+ * @param locale the locale for which a resource bundle is desired
+ * @param loader the class loader from which to load the resource bundle
+ * @return a resource bundle for the given base name and locale
+ *
* @see ResourceBundle#getBundle(String, Locale, ClassLoader)
*/
public static ResourceBundle getEquinoxResourceBundle(String baseName, Locale locale, ClassLoader loader) {
ResourceBundle resourceBundle = null;
-
- String equinoxLocale = getEquinoxRootLocale();
- //if the equinox.root.locale is not empty and the specified locale equals the equinox.root.locale
+
+ final String equinoxLocale = getEquinoxRootLocale();
+ // if the equinox.root.locale is not empty and the specified locale equals the equinox.root.locale
// -> use the special search order
- if (equinoxLocale.length() > 0 && locale.toString().startsWith(equinoxLocale)) {
- //there is a equinox.root.locale configured that matches the specified locale
- //so the special search order is used
- //to achieve this we first search without a fallback to the default locale
- try {
- resourceBundle = ResourceBundle.getBundle(baseName, locale, loader,
- ResourceBundle.Control.getNoFallbackControl(Control.FORMAT_DEFAULT));
- }
- catch (MissingResourceException e) {
- //do nothing
- }
- //if there is no ResourceBundle found for that path, we will now search for the default locale ResourceBundle
- if (resourceBundle == null) {
- try {
- resourceBundle = ResourceBundle.getBundle(baseName, Locale.getDefault(), loader,
- ResourceBundle.Control.getNoFallbackControl(Control.FORMAT_DEFAULT));
- }
- catch (MissingResourceException e) {
- //do nothing
- }
- }
- }
- else {
- //there is either no equinox.root.locale configured or it does not match the specified locale
- // -> use the default search order
- try {
- resourceBundle = ResourceBundle.getBundle(baseName, locale, loader);
- }
- catch (MissingResourceException e) {
- //do nothing
- }
- }
-
- return resourceBundle;
- }
-
+ if (equinoxLocale.length() > 0 && locale.toString().startsWith(equinoxLocale)) {
+ // there is a equinox.root.locale configured that matches the specified locale
+ // so the special search order is used
+ // to achieve this we first search without a fallback to the default locale
+ try {
+ resourceBundle = ResourceBundle.getBundle(baseName, locale, loader,
+ ResourceBundle.Control.getNoFallbackControl(Control.FORMAT_DEFAULT));
+ } catch (final MissingResourceException e) {
+ // do nothing
+ }
+ // if there is no ResourceBundle found for that path, we will now search for the default locale
+ // ResourceBundle
+ if (resourceBundle == null) {
+ try {
+ resourceBundle = ResourceBundle.getBundle(baseName, Locale.getDefault(), loader,
+ ResourceBundle.Control.getNoFallbackControl(Control.FORMAT_DEFAULT));
+ } catch (final MissingResourceException e) {
+ // do nothing
+ }
+ }
+ }
+ else {
+ // there is either no equinox.root.locale configured or it does not match the specified locale
+ // -> use the default search order
+ try {
+ resourceBundle = ResourceBundle.getBundle(baseName, locale, loader);
+ } catch (final MissingResourceException e) {
+ // do nothing
+ }
+ }
+
+ return resourceBundle;
+ }
+
/**
- * This method searches for the {@link ResourceBundle} in a modified way by inspecting the configuration option
+ * This method searches for the {@link ResourceBundle} in a modified way by inspecting the configuration option
* <code>equinox.root.locale</code>. It uses the {@link BundleResourceBundleControl} to load the resources out
* of a {@link Bundle}.
- * <p><b>Note: This method will only search for ResourceBundles based on properties files.</b></p>
* <p>
- * If the value for this system property is set to an empty String the default search order for ResourceBundles is used:
+ * <b>Note: This method will only search for ResourceBundles based on properties files.</b>
+ * </p>
+ * <p>
+ * If the value for this system property is set to an empty String the default search order for ResourceBundles is
+ * used:
* <ul>
* <li>bn + Ls + "_" + Cs + "_" + Vs</li>
* <li>bn + Ls + "_" + Cs</li>
@@ -257,8 +273,8 @@ public class ResourceBundleHelper {
* <li>bn + Ld</li>
* <li>bn</li>
* </ul>
- * Where bn is this bundle's localization basename, Ls, Cs and Vs are the specified locale (language, country, variant) and
- * Ld, Cd and Vd are the default locale (language, country, variant).
+ * Where bn is this bundle's localization basename, Ls, Cs and Vs are the specified locale (language, country,
+ * variant) and Ld, Cd and Vd are the default locale (language, country, variant).
* </p>
* <p>
* If Ls equals the value of <code>equinox.root.locale</code> then the following search order is used:
@@ -273,27 +289,31 @@ public class ResourceBundleHelper {
* <li>bn</li>
* </ul>
* </p>
- * If <code>equinox.root.locale=en</code> and en_XX or en is asked for then this allows the root file to be used instead of
+ * If <code>equinox.root.locale=en</code> and en_XX or en is asked for then this allows the root file to be used
+ * instead of
* falling back to the default locale.
- *
- * @param baseName the base name of the resource bundle, a fully qualified class name
- * @param locale the locale for which a resource bundle is desired
+ *
+ * @param baseName the base name of the resource bundle, a fully qualified class name
+ * @param locale the locale for which a resource bundle is desired
* @param bundle The OSGi {@link Bundle} to lookup the {@link ResourceBundle}
- * @return a resource bundle for the given base name and locale
- *
+ * @return a resource bundle for the given base name and locale
+ *
* @see ResourceBundle#getBundle(String, Locale, Control)
*/
public static ResourceBundle getEquinoxResourceBundle(String baseName, Locale locale, Bundle bundle) {
- return getEquinoxResourceBundle(baseName, locale,
- new BundleResourceBundleControl(bundle, true), new BundleResourceBundleControl(bundle, false));
+ return getEquinoxResourceBundle(baseName, locale,
+ new BundleResourceBundleControl(bundle, true), new BundleResourceBundleControl(bundle, false));
}
/**
- * This method searches for the {@link ResourceBundle} in a modified way by inspecting the configuration option
+ * This method searches for the {@link ResourceBundle} in a modified way by inspecting the configuration option
* <code>equinox.root.locale</code>.
- * <p><b>Note: This method will only search for ResourceBundles based on properties files.</b></p>
* <p>
- * If the value for this system property is set to an empty String the default search order for ResourceBundles is used:
+ * <b>Note: This method will only search for ResourceBundles based on properties files.</b>
+ * </p>
+ * <p>
+ * If the value for this system property is set to an empty String the default search order for ResourceBundles is
+ * used:
* <ul>
* <li>bn + Ls + "_" + Cs + "_" + Vs</li>
* <li>bn + Ls + "_" + Cs</li>
@@ -303,8 +323,8 @@ public class ResourceBundleHelper {
* <li>bn + Ld</li>
* <li>bn</li>
* </ul>
- * Where bn is this bundle's localization basename, Ls, Cs and Vs are the specified locale (language, country, variant) and
- * Ld, Cd and Vd are the default locale (language, country, variant).
+ * Where bn is this bundle's localization basename, Ls, Cs and Vs are the specified locale (language, country,
+ * variant) and Ld, Cd and Vd are the default locale (language, country, variant).
* </p>
* <p>
* If Ls equals the value of <code>equinox.root.locale</code> then the following search order is used:
@@ -319,60 +339,61 @@ public class ResourceBundleHelper {
* <li>bn</li>
* </ul>
* </p>
- * If <code>equinox.root.locale=en</code> and en_XX or en is asked for then this allows the root file to be used instead of
+ * If <code>equinox.root.locale=en</code> and en_XX or en is asked for then this allows the root file to be used
+ * instead of
* falling back to the default locale.
- *
- * @param baseName the base name of the resource bundle, a fully qualified class name
- * @param locale the locale for which a resource bundle is desired
+ *
+ * @param baseName the base name of the resource bundle, a fully qualified class name
+ * @param locale the locale for which a resource bundle is desired
* @param withFallback The {@link Control} that uses the default locale fallback on searching for resource bundles.
- * @param withoutFallback The {@link Control} that doesn't use the default locale fallback on searching for resource bundles.
- * @return a resource bundle for the given base name and locale
- *
+ * @param withoutFallback The {@link Control} that doesn't use the default locale fallback on searching for resource
+ * bundles.
+ * @return a resource bundle for the given base name and locale
+ *
* @see ResourceBundle#getBundle(String, Locale, Control)
*/
- public static ResourceBundle getEquinoxResourceBundle(String baseName, Locale locale, Control withFallback, Control withoutFallback) {
+ public static ResourceBundle getEquinoxResourceBundle(String baseName, Locale locale, Control withFallback,
+ Control withoutFallback) {
ResourceBundle resourceBundle = null;
-
- String equinoxLocale = getEquinoxRootLocale();
- //if the equinox.root.locale is not empty and the specified locale equals the equinox.root.locale
+
+ final String equinoxLocale = getEquinoxRootLocale();
+ // if the equinox.root.locale is not empty and the specified locale equals the equinox.root.locale
// -> use the special search order
- if (equinoxLocale.length() > 0 && locale.toString().startsWith(equinoxLocale)) {
- //there is a equinox.root.locale configured that matches the specified locale
- //so the special search order is used
- //to achieve this we first search without a fallback to the default locale
- try {
- resourceBundle = ResourceBundle.getBundle(baseName, locale, withoutFallback);
- }
- catch (MissingResourceException e) {
- //do nothing
- }
- //if there is no ResourceBundle found for that path, we will now search for the default locale ResourceBundle
- if (resourceBundle == null) {
- try {
- resourceBundle = ResourceBundle.getBundle(baseName, Locale.getDefault(), withoutFallback);
- }
- catch (MissingResourceException e) {
- //do nothing
- }
- }
- }
- else {
- //there is either no equinox.root.locale configured or it does not match the specified locale
- // -> use the default search order
- try {
- resourceBundle = ResourceBundle.getBundle(baseName, locale, withFallback);
- }
- catch (MissingResourceException e) {
- //do nothing
- }
- }
-
+ if (equinoxLocale.length() > 0 && locale.toString().startsWith(equinoxLocale)) {
+ // there is a equinox.root.locale configured that matches the specified locale
+ // so the special search order is used
+ // to achieve this we first search without a fallback to the default locale
+ try {
+ resourceBundle = ResourceBundle.getBundle(baseName, locale, withoutFallback);
+ } catch (final MissingResourceException e) {
+ // do nothing
+ }
+ // if there is no ResourceBundle found for that path, we will now search for the default locale
+ // ResourceBundle
+ if (resourceBundle == null) {
+ try {
+ resourceBundle = ResourceBundle.getBundle(baseName, Locale.getDefault(), withoutFallback);
+ } catch (final MissingResourceException e) {
+ // do nothing
+ }
+ }
+ }
+ else {
+ // there is either no equinox.root.locale configured or it does not match the specified locale
+ // -> use the default search order
+ try {
+ resourceBundle = ResourceBundle.getBundle(baseName, locale, withFallback);
+ } catch (final MissingResourceException e) {
+ // do nothing
+ }
+ }
+
return resourceBundle;
}
/**
* @return The value for the system property for key <code>equinox.root.locale</code>.
- * If none is specified than <b>en</b> will be returned as default.
+ * If none is specified than <b>en</b> will be returned as default.
*/
private static String getEquinoxRootLocale() {
// Logic from FrameworkProperties.getProperty("equinox.root.locale", "en")
@@ -386,16 +407,17 @@ public class ResourceBundleHelper {
/**
* This method is copied out of org.eclipse.e4.ui.internal.workbench.Activator
* because as it is a internal resource, it is not accessible for us.
- *
+ *
* @param bundleName
* the bundle id
* @return A bundle if found, or <code>null</code>
*/
public static Bundle getBundleForName(String bundleName) {
- PackageAdmin packageAdmin = ToolsServicesActivator.getDefault().getPackageAdmin();
- Bundle[] bundles = packageAdmin.getBundles(bundleName, null);
- if (bundles == null)
+ final PackageAdmin packageAdmin = ToolsServicesActivator.getDefault().getPackageAdmin();
+ final Bundle[] bundles = packageAdmin.getBundles(bundleName, null);
+ if (bundles == null) {
return null;
+ }
// Return the first bundle that is not installed or uninstalled
for (int i = 0; i < bundles.length; i++) {
if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
@@ -404,177 +426,179 @@ public class ResourceBundleHelper {
}
return null;
}
-
- /**
- * <p>Converts a String to a Locale.</p>
- *
- * <p>This method takes the string format of a locale and creates the
- * locale object from it.</p>
- *
- * <pre>
- * MessageFactoryServiceImpl.toLocale("en") = new Locale("en", "")
- * MessageFactoryServiceImpl.toLocale("en_GB") = new Locale("en", "GB")
- * MessageFactoryServiceImpl.toLocale("en_GB_xxx") = new Locale("en", "GB", "xxx")
- * </pre>
- *
- * <p>This method validates the input strictly.
- * The language code must be lowercase.
- * The country code must be uppercase.
- * The separator must be an underscore.
- * The length must be correct.
- * </p>
- *
- * <p>This method is inspired by <code>org.apache.commons.lang.LocaleUtils.toLocale(String)</code> by
- * fixing the parsing error for uncommon Locales like having a language and a variant code but
- * no country code, or a Locale that only consists of a country code.
- * </p>
- *
- * @param str the locale String to convert
- * @return a Locale that matches the specified locale String or <code>null</code>
- * if the specified String is <code>null</code>
- * @throws IllegalArgumentException if the String is an invalid format
- */
+
+ /**
+ * <p>
+ * Converts a String to a Locale.
+ * </p>
+ *
+ * <p>
+ * This method takes the string format of a locale and creates the locale object from it.
+ * </p>
+ *
+ * <pre>
+ * MessageFactoryServiceImpl.toLocale("en") = new Locale("en", "")
+ * MessageFactoryServiceImpl.toLocale("en_GB") = new Locale("en", "GB")
+ * MessageFactoryServiceImpl.toLocale("en_GB_xxx") = new Locale("en", "GB", "xxx")
+ * </pre>
+ *
+ * <p>
+ * This method validates the input strictly. The language code must be lowercase. The country code must be
+ * uppercase. The separator must be an underscore. The length must be correct.
+ * </p>
+ *
+ * <p>
+ * This method is inspired by <code>org.apache.commons.lang.LocaleUtils.toLocale(String)</code> by fixing the
+ * parsing error for uncommon Locales like having a language and a variant code but no country code, or a Locale
+ * that only consists of a country code.
+ * </p>
+ *
+ * @param str the locale String to convert
+ * @return a Locale that matches the specified locale String or <code>null</code> if the specified String is
+ * <code>null</code>
+ * @throws IllegalArgumentException if the String is an invalid format
+ */
public static Locale toLocale(String str) {
- if (str == null) {
- return null;
- }
-
- String language = ""; //$NON-NLS-1$
- String country = ""; //$NON-NLS-1$
- String variant = ""; //$NON-NLS-1$
-
- String[] localeParts = str.split("_"); //$NON-NLS-1$
- if (localeParts.length == 0 || localeParts.length > 3
- || (localeParts.length == 1 && localeParts[0].length() == 0)) {
- throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
- } else {
- if (localeParts[0].length() == 1 || localeParts[0].length() > 2) {
- throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
- }
- else if (localeParts[0].length() == 2) {
- char ch0 = localeParts[0].charAt(0);
- char ch1 = localeParts[0].charAt(1);
- if (ch0 < 'a' || ch0 > 'z' || ch1 < 'a' || ch1 > 'z') {
- throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
- }
- }
-
- language = localeParts[0];
-
- if (localeParts.length > 1) {
- if (localeParts[1].length() == 1 || localeParts[1].length() > 2) {
- throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
- }
- else if (localeParts[1].length() == 2) {
- char ch3 = localeParts[1].charAt(0);
- char ch4 = localeParts[1].charAt(1);
- if (ch3 < 'A' || ch3 > 'Z' || ch4 < 'A' || ch4 > 'Z') {
- throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
- }
- }
-
- country = localeParts[1];
- }
-
- if (localeParts.length == 3) {
- if (localeParts[0].length() == 0 && localeParts[1].length() == 0) {
- throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
- }
- variant = localeParts[2];
- }
- }
-
- return new Locale(language, country, variant);
- }
-
+ if (str == null) {
+ return null;
+ }
+
+ String language = ""; //$NON-NLS-1$
+ String country = ""; //$NON-NLS-1$
+ String variant = ""; //$NON-NLS-1$
+
+ final String[] localeParts = str.split("_"); //$NON-NLS-1$
+ if (localeParts.length == 0 || localeParts.length > 3
+ || localeParts.length == 1 && localeParts[0].length() == 0) {
+ throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
+ }
+ if (localeParts[0].length() == 1 || localeParts[0].length() > 2) {
+ throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
+ }
+ else if (localeParts[0].length() == 2) {
+ final char ch0 = localeParts[0].charAt(0);
+ final char ch1 = localeParts[0].charAt(1);
+ if (ch0 < 'a' || ch0 > 'z' || ch1 < 'a' || ch1 > 'z') {
+ throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
+ }
+ }
+
+ language = localeParts[0];
+
+ if (localeParts.length > 1) {
+ if (localeParts[1].length() == 1 || localeParts[1].length() > 2) {
+ throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
+ }
+ else if (localeParts[1].length() == 2) {
+ final char ch3 = localeParts[1].charAt(0);
+ final char ch4 = localeParts[1].charAt(1);
+ if (ch3 < 'A' || ch3 > 'Z' || ch4 < 'A' || ch4 > 'Z') {
+ throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
+ }
+ }
+
+ country = localeParts[1];
+ }
+
+ if (localeParts.length == 3) {
+ if (localeParts[0].length() == 0 && localeParts[1].length() == 0) {
+ throw new IllegalArgumentException("Invalid locale format: " + str); //$NON-NLS-1$
+ }
+ variant = localeParts[2];
+ }
+
+ return new Locale(language, country, variant);
+ }
+
/**
* Specialization of {@link Control} which loads the {@link ResourceBundle} out of an
* OSGi {@link Bundle} instead of using a classloader.
- *
- * <p>It only supports properties based {@link ResourceBundle}s. If you want to use
- * source based {@link ResourceBundle}s you have to use the bundleclass URI with the
- * Message annotation.
- *
+ *
+ * <p>
+ * It only supports properties based {@link ResourceBundle}s. If you want to use source based {@link ResourceBundle}
+ * s you have to use the bundleclass URI with the Message annotation.
+ *
* @author Dirk Fauth
*
*/
static class BundleResourceBundleControl extends ResourceBundle.Control {
-
+
/**
* Flag to determine whether the default locale should be used as fallback locale
* in case there is no {@link ResourceBundle} found for the specified locale.
*/
private final boolean useFallback;
-
+
/**
* The OSGi {@link Bundle} to lookup the {@link ResourceBundle}
*/
private final Bundle osgiBundle;
-
+
/**
- *
+ *
* @param osgiBundle The OSGi {@link Bundle} to lookup the {@link ResourceBundle}
* @param useFallback <code>true</code> if the default locale should be used as fallback
- * locale in the search path or <code>false</code> if there should be no fallback.
+ * locale in the search path or <code>false</code> if there should be no fallback.
*/
public BundleResourceBundleControl(Bundle osgiBundle, boolean useFallback) {
this.osgiBundle = osgiBundle;
this.useFallback = useFallback;
}
-
+
@Override
public ResourceBundle newBundle(String baseName, Locale locale,
- String format, ClassLoader loader, boolean reload)
+ String format, ClassLoader loader, boolean reload)
throws IllegalAccessException, InstantiationException, IOException {
- String bundleName = toBundleName(baseName, locale);
- ResourceBundle bundle = null;
- if (format.equals("java.properties")) { //$NON-NLS-1$
+ final String bundleName = toBundleName(baseName, locale);
+ ResourceBundle bundle = null;
+ if (format.equals("java.properties")) { //$NON-NLS-1$
final String resourceName = toResourceName(bundleName, "properties"); //$NON-NLS-1$
InputStream stream = null;
try {
- stream = AccessController.doPrivileged(
+ stream = AccessController.doPrivileged(
new PrivilegedExceptionAction<InputStream>() {
- public InputStream run() throws IOException {
+ @Override
+ public InputStream run() throws IOException {
InputStream is = null;
- URL url = osgiBundle.getEntry(resourceName);
- if (url != null) {
- URLConnection connection = url.openConnection();
+ final URL url = osgiBundle.getEntry(resourceName);
+ if (url != null) {
+ final URLConnection connection = url.openConnection();
if (connection != null) {
- // Disable caches to get fresh data for
- // reloading.
- connection.setUseCaches(false);
- is = connection.getInputStream();
+ // Disable caches to get fresh data for
+ // reloading.
+ connection.setUseCaches(false);
+ is = connection.getInputStream();
}
- }
+ }
return is;
- }
+ }
});
- } catch (PrivilegedActionException e) {
- throw (IOException) e.getException();
+ } catch (final PrivilegedActionException e) {
+ throw (IOException) e.getException();
}
if (stream != null) {
- try {
- bundle = new PropertyResourceBundle(stream);
- } finally {
- stream.close();
- }
+ try {
+ bundle = new PropertyResourceBundle(stream);
+ } finally {
+ stream.close();
+ }
}
- }
- else {
- throw new IllegalArgumentException("unknown format: " + format); //$NON-NLS-1$
- }
- return bundle;
+ }
+ else {
+ throw new IllegalArgumentException("unknown format: " + format); //$NON-NLS-1$
+ }
+ return bundle;
}
-
+
@Override
public List<String> getFormats(String baseName) {
return FORMAT_PROPERTIES;
}
-
+
@Override
public Locale getFallbackLocale(String baseName, Locale locale) {
- return this.useFallback ? super.getFallbackLocale(baseName, locale) : null;
+ return useFallback ? super.getFallbackLocale(baseName, locale) : null;
}
}
}
diff --git a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourcePoolFactory.java b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourcePoolFactory.java
index ac602dd2..43b46b71 100644
--- a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourcePoolFactory.java
+++ b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourcePoolFactory.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
******************************************************************************/
package org.eclipse.e4.tools.services.impl;
@@ -18,7 +18,7 @@ import org.eclipse.e4.tools.services.impl.ResourceService.ResourcePool;
public class ResourcePoolFactory extends ContextFunction {
@Override
- public Object compute(IEclipseContext context) {
+ public Object compute(IEclipseContext context, String contextKey) {
return ContextInjectionFactory.make(ResourcePool.class, context);
}
diff --git a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceService.java b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceService.java
index 468cfaf9..773cfdf1 100644
--- a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceService.java
+++ b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceService.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
******************************************************************************/
package org.eclipse.e4.tools.services.impl;
@@ -25,6 +25,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.e4.tools.services.IResourcePool;
import org.eclipse.e4.tools.services.IResourceProviderService;
import org.eclipse.e4.tools.services.IResourceService;
+import org.eclipse.e4.tools.services.ToolsServicesActivator;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Color;
@@ -45,30 +46,33 @@ public class ResourceService implements IResourceService {
}
static class PooledResource<T extends Resource> implements
- IPooledResource<T> {
- private Display display;
+ IPooledResource<T> {
+ private final Display display;
private int count;
private T resource;
private String id;
private ResourceService resourceService;
PooledResource(Display display, ResourceService resourceService,
- String id, T resource) {
+ String id, T resource) {
this.display = display;
this.id = id;
this.count = 1;
this.resourceService = resourceService;
this.resource = resource;
}
-
+
+ @Override
public String getId() {
return id;
}
+ @Override
public T getResource() {
return resource;
}
+ @Override
public void dispose() {
this.count--;
if (this.count == 0) {
@@ -89,24 +93,25 @@ public class ResourceService implements IResourceService {
private List<IPooledResource<Image>> pooledImages = new ArrayList<IPooledResource<Image>>();
private List<IPooledResource<Font>> pooledFonts = new ArrayList<IPooledResource<Font>>();
private List<IPooledResource<Color>> pooledColors = new ArrayList<IPooledResource<Color>>();
- private Display display;
+ private final Display display;
@Inject
public ResourcePool(IResourceService resourceService, Display display) {
this.display = display;
- this.resourceService = (ResourceService) resourceService;
+ this.resourceService = resourceService;
}
+ @Override
public Image getImage(String key) throws CoreException {
if (resourceService == null) {
throw new CoreException(
- new Status(IStatus.ERROR,
- "org.eclipse.e4.tools.services",
- "The pool is disposed"));
+ new Status(IStatus.ERROR,
+ ToolsServicesActivator.PLUGIN_ID,
+ Messages.ResourceService_PoolDisposed));
}
IPooledResource<Image> image = null;
- for (IPooledResource<Image> img : pooledImages) {
+ for (final IPooledResource<Image> img : pooledImages) {
if (img.getId().equals(key)) {
image = img;
}
@@ -115,87 +120,93 @@ public class ResourceService implements IResourceService {
image = resourceService.getImage(display, key);
pooledImages.add(image);
}
-
+
return image.getResource();
}
+ @Override
public Font getFont(String key) throws CoreException {
if (resourceService == null) {
throw new CoreException(
- new Status(IStatus.ERROR,
- "org.eclipse.e4.tools.services",
- "The pool is disposed"));
+ new Status(IStatus.ERROR,
+ ToolsServicesActivator.PLUGIN_ID,
+ Messages.ResourceService_PoolDisposed));
}
-
+
IPooledResource<Font> font = null;
- for (IPooledResource<Font> fon : pooledFonts) {
+ for (final IPooledResource<Font> fon : pooledFonts) {
if (fon.getId().equals(key)) {
font = fon;
}
}
- if( font == null ) {
+ if (font == null) {
font = resourceService.getFont(display, key);
- pooledFonts.add(font);
+ pooledFonts.add(font);
}
return font.getResource();
}
+ @Override
public Color getColor(String key) throws CoreException {
if (resourceService == null) {
throw new CoreException(
- new Status(IStatus.ERROR,
- "org.eclipse.e4.tools.services",
- "The pool is disposed"));
+ new Status(IStatus.ERROR,
+ ToolsServicesActivator.PLUGIN_ID,
+ Messages.ResourceService_PoolDisposed));
}
IPooledResource<Color> color = null;
-
- for (IPooledResource<Color> col : pooledColors) {
+
+ for (final IPooledResource<Color> col : pooledColors) {
if (col.getId().equals(key)) {
color = col;
}
}
-
- if( color == null ) {
+
+ if (color == null) {
color = resourceService.getColor(display,
- key);
- pooledColors.add(color);
+ key);
+ pooledColors.add(color);
}
return color.getResource();
}
+ @Override
public Image getImageUnchecked(String key) {
try {
return getImage(key);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
return null;
}
}
+ @Override
public Font getFontUnchecked(String key) {
try {
return getFont(key);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
return null;
}
}
+ @Override
public Color getColorUnchecked(String key) {
try {
return getColor(key);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
return null;
}
}
+ @Override
@PreDestroy
public void dispose() {
- for (IPooledResource<Image> img : pooledImages) {
+ for (final IPooledResource<Image> img : pooledImages) {
img.dispose();
}
- for (IPooledResource<Font> font : pooledFonts) {
+ for (final IPooledResource<Font> font : pooledFonts) {
font.dispose();
}
- for (IPooledResource<Color> col : pooledColors) {
+ for (final IPooledResource<Color> col : pooledColors) {
col.dispose();
}
resourceService = null;
@@ -232,17 +243,17 @@ public class ResourceService implements IResourceService {
}
}
- private Map<Display, DisplayPool> displayPool = new HashMap<Display, ResourceService.DisplayPool>();
+ private final Map<Display, DisplayPool> displayPool = new HashMap<Display, ResourceService.DisplayPool>();
// private Map<String, IResourceProviderService> imagekey2providers = new
// HashMap<String, IResourceProviderService>();
// private Map<String, IResourceProviderService> fontkey2providers = new
// HashMap<String, IResourceProviderService>();
// private Map<String, IResourceProviderService> colorkey2providers = new
// HashMap<String, IResourceProviderService>();
- private BundleContext context;
+ private final BundleContext context;
public ResourceService() {
- Bundle b = FrameworkUtil.getBundle(ResourceService.class);
+ final Bundle b = FrameworkUtil.getBundle(ResourceService.class);
context = b.getBundleContext();
}
@@ -258,7 +269,7 @@ public class ResourceService implements IResourceService {
@SuppressWarnings("unchecked")
private <R extends Resource> PooledResource<R> loadResource(
- Display display, String key, Type type) {
+ Display display, String key, Type type) {
DisplayPool p = displayPool.get(display);
PooledResource<R> resource = null;
@@ -276,7 +287,7 @@ public class ResourceService implements IResourceService {
resource.count++;
} else {
resource = new PooledResource<R>(display, this, key,
- (R) lookupResource(display, key, type));
+ (R) lookupResource(display, key, type));
if (p == null) {
p = new DisplayPool();
@@ -300,37 +311,37 @@ public class ResourceService implements IResourceService {
private <R> R lookupResource(Display display, String key, Type type) {
if (type == Type.IMAGE) {
- IResourceProviderService provider = lookupOSGI(key);
+ final IResourceProviderService provider = lookupOSGI(key);
if (provider != null) {
return (R) provider.getImage(display, key);
}
} else if (type == Type.COLOR) {
- IResourceProviderService provider = lookupOSGI(key);
+ final IResourceProviderService provider = lookupOSGI(key);
if (provider != null) {
return (R) provider.getColor(display, key);
}
} else {
- IResourceProviderService provider = lookupOSGI(key);
+ final IResourceProviderService provider = lookupOSGI(key);
if (provider != null) {
return (R) provider.getFont(display, key);
}
}
- throw new IllegalArgumentException("No provider known for '" + key
- + "'.");
+ throw new IllegalArgumentException(Messages.ResourceService_NoProvider + key
+ + "'."); //$NON-NLS-1$
}
private IResourceProviderService lookupOSGI(String key) {
try {
- Collection<ServiceReference<IResourceProviderService>> refs = context
- .getServiceReferences(IResourceProviderService.class, "("
- + key + "=*)");
+ final Collection<ServiceReference<IResourceProviderService>> refs = context
+ .getServiceReferences(IResourceProviderService.class, "(" //$NON-NLS-1$
+ + key + "=*)"); //$NON-NLS-1$
if (!refs.isEmpty()) {
- ServiceReference<IResourceProviderService> ref = refs
- .iterator().next();
+ final ServiceReference<IResourceProviderService> ref = refs
+ .iterator().next();
return context.getService(ref);
}
- } catch (InvalidSyntaxException e) {
+ } catch (final InvalidSyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@@ -363,26 +374,32 @@ public class ResourceService implements IResourceService {
// }
// }
+ @Override
public PooledResource<Image> getImage(Display display, String key) {
return loadResource(display, key, Type.IMAGE);
}
+ @Override
public PooledResource<Color> getColor(Display display, String key) {
return loadResource(display, key, Type.COLOR);
}
+ @Override
public PooledResource<Font> getFont(Display display, String key) {
return loadResource(display, key, Type.FONT);
}
+ @Override
public IDiposeableResourcePool getResourcePool(Display display) {
return new ResourcePool(this, display);
}
+ @Override
public IResourcePool getControlPool(Control control) {
final ResourcePool pool = new ResourcePool(this, control.getDisplay());
control.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
pool.dispose();
}
diff --git a/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/messages.properties b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/messages.properties
new file mode 100644
index 00000000..e7f5b650
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/messages.properties
@@ -0,0 +1,2 @@
+ResourceService_NoProvider=No provider known for '
+ResourceService_PoolDisposed=The pool is disposed

Back to the top