diff options
author | Steffen Pingel | 2011-10-08 18:38:38 +0000 |
---|---|---|
committer | Steffen Pingel | 2011-10-08 18:38:38 +0000 |
commit | c50ec1fb00f710bb7738999c384b844a8ed57491 (patch) | |
tree | 8f4ad444b14647aea358ebbba63ccebdd04199da | |
parent | 00daf90746304317a089c3caa2d9ff84b8d8077d (diff) | |
download | org.eclipse.mylyn.commons-c50ec1fb00f710bb7738999c384b844a8ed57491.tar.gz org.eclipse.mylyn.commons-c50ec1fb00f710bb7738999c384b844a8ed57491.tar.xz org.eclipse.mylyn.commons-c50ec1fb00f710bb7738999c384b844a8ed57491.zip |
NEW - bug 359461: move user activity monitoring into a separate bundle
https://bugs.eclipse.org/bugs/show_bug.cgi?id=359461
Change-Id: I9937b91d657f42caf2b25621a29391c7fa567197
46 files changed, 2874 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.commons.activity.tests/.classpath b/org.eclipse.mylyn.commons.activity.tests/.classpath new file mode 100644 index 00000000..71ff97dd --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.classpath @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry excluding="org/eclipse/mylar/monitor/usage/tests/" kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"> + <accessrules> + <accessrule kind="accessible" pattern="org/eclipse/mylyn/**"/> + <accessrule kind="accessible" pattern="**/internal/**"/> + </accessrules> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"> + <accessrules> + <accessrule kind="nonaccessible" pattern="com/sun/**"/> + </accessrules> + </classpathentry> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/org.eclipse.mylyn.commons.activity.tests/.cvsignore b/org.eclipse.mylyn.commons.activity.tests/.cvsignore new file mode 100644 index 00000000..c3c0137d --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.cvsignore @@ -0,0 +1,3 @@ +bin +target +mylyn-monitor-tests.jar diff --git a/org.eclipse.mylyn.commons.activity.tests/.project b/org.eclipse.mylyn.commons.activity.tests/.project new file mode 100644 index 00000000..077303e3 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.mylyn.commons.activity.tests</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> + </natures> +</projectDescription> diff --git a/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..dc67eda8 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,357 @@ +#Wed Mar 02 16:00:03 PST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled +org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL +org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_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=48 +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_selector_in_method_invocation=80 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.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=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +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=insert +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_member=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=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_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +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_outer_expressions_when_nested=true diff --git a/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..11031cff --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,63 @@ +#Wed Mar 02 16:00:07 PST 2011 +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_Mylyn based on Eclipse +formatter_settings_version=12 +internal.default.compliance=default +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\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\="true" 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 * \r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\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"/><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\r\n * Copyright (c) ${year} Tasktop Technologies and others.\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 * Tasktop Technologies - initial API and implementation\r\n *******************************************************************************/\r\n\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">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ignore\r\n${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ignore</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\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.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\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.wst.jsdt.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.wst.jsdt.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.wst.jsdt.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.wst.jsdt.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.wst.jsdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\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.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=true +sp_cleanup.correct_indentation=true +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_variable_declarations_final=true +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=true +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 00000000..5e7f2bd4 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Tue Aug 18 22:42:26 PDT 2009 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 00000000..d8c6d26a --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Mon Jun 25 03:02:37 GMT 2007 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.pde.api.tools.prefs b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000..d51268cb --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,145 @@ +#Tue Apr 08 17:50:00 PDT 2008 +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_LEAK=Ignore +API_PROFILE_ELEMENT_TYPE_REMOVED_API_COMPONENT=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_ADDED_FIELD=Error +ENUM_ELEMENT_TYPE_ADDED_METHOD=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=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_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Ignore +ILLEGAL_IMPLEMENT=Ignore +ILLEGAL_INSTANTIATE=Ignore +ILLEGAL_OVERRIDE=Ignore +ILLEGAL_REFERENCE=Ignore +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=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_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error diff --git a/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000..e8f2d562 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,18 @@ +#Tue Apr 15 11:07:59 PDT 2008 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=2 +compilers.p.missing-bundle-classpath-entries=1 +compilers.p.missing-packages=1 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=2 +compilers.p.unknown-attribute=0 +compilers.p.unknown-class=0 +compilers.p.unknown-element=0 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=0 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/org.eclipse.mylyn.commons.activity.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.activity.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000..42d92691 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Mylyn Commons Activity Monitor Tests +Bundle-SymbolicName: org.eclipse.mylyn.commons.activity.tests;singleton:=true +Bundle-Version: 3.7.0.qualifier +Bundle-Vendor: Eclipse Mylyn +Require-Bundle: org.eclipse.core.runtime, + org.junit, + org.eclipse.mylyn.commons.activity.ui +Export-Package: org.eclipse.mylyn.commons.activity.tests;x-internal:=true +Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/org.eclipse.mylyn.commons.activity.tests/about.html b/org.eclipse.mylyn.commons.activity.tests/about.html new file mode 100644 index 00000000..d774b07c --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/about.html @@ -0,0 +1,27 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> +<html> +<head> +<title>About</title> +<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 25, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/org.eclipse.mylyn.commons.activity.tests/build.properties b/org.eclipse.mylyn.commons.activity.tests/build.properties new file mode 100644 index 00000000..b73e0203 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/build.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2004, 2008 Mylyn project committers 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 +############################################################################### +bin.includes = META-INF/,\ + .,\ + about.html +source.. = src/ +output.. = bin/ +src.includes = about.html +jre.compilation.profile = J2SE-1.5 diff --git a/org.eclipse.mylyn.commons.activity.tests/pom.xml b/org.eclipse.mylyn.commons.activity.tests/pom.xml new file mode 100644 index 00000000..18041cb0 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/pom.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>org.eclipse.mylyn.commons-parent</artifactId> + <groupId>org.eclipse.mylyn.commons</groupId> + <version>3.7.0-SNAPSHOT</version> + </parent> + <artifactId>org.eclipse.mylyn.commons.activity.tests</artifactId> + <version>3.7.0-SNAPSHOT</version> + <packaging>eclipse-test-plugin</packaging> + <properties> + <test.suite>${project.artifactId}.AllActivityTests</test.suite> + </properties> + <build> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-source-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-surefire-plugin</artifactId> + <version>${tycho-version}</version> + <configuration> + <testSuite>${project.artifactId}</testSuite> + <testClass>${test.suite}</testClass> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/AllActivityTests.java b/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/AllActivityTests.java new file mode 100644 index 00000000..57b4b444 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/AllActivityTests.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.commons.activity.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Steffen Pingel + */ +public class AllActivityTests { + + public static Test suite() { + TestSuite suite = new TestSuite(AllActivityTests.class.getName()); + suite.addTestSuite(MonitorUserActivityJobTest.class); + suite.addTestSuite(UserActivityManagerTest.class); + return suite; + } + +} diff --git a/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/MonitorUserActivityJobTest.java b/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/MonitorUserActivityJobTest.java new file mode 100644 index 00000000..7848df65 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/MonitorUserActivityJobTest.java @@ -0,0 +1,210 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.commons.activity.tests; + +import junit.framework.TestCase; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.mylyn.internal.commons.activity.ui.IUserActivityManagerCallback; +import org.eclipse.mylyn.internal.commons.activity.ui.MonitorUserActivityJob; + +/** + * @author Steffen Pingel + */ +public class MonitorUserActivityJobTest extends TestCase { + + private StubCallback callback; + + private TestableCheckActivityJob job; + + @Override + protected void setUp() throws Exception { + callback = new StubCallback(); + job = new TestableCheckActivityJob(callback); + } + + public void testInactivityTimeout() throws Exception { + callback.lastEventTime = System.currentTimeMillis() - 201; + job.setInactivityTimeout(200); + job.run(); + assertFalse(job.isActive()); + job.run(); + assertFalse(job.isActive()); + callback.lastEventTime = System.currentTimeMillis(); + job.run(); + assertTrue(job.isActive()); + assertEquals(0, callback.activeTime); + Thread.sleep(6); + job.run(); + long slept = System.currentTimeMillis() - callback.lastEventTime; + assertTrue(job.isActive()); + assertTrue("expected less than 5 < activeTime < 40, got " + callback.activeTime + " (slept " + slept + " ms)", + callback.activeTime > 5 && callback.activeTime < 40); + } + + public void testResumeFromSleepNoTimeout() throws Exception { + job.setInactivityTimeout(0); + job.run(); + assertTrue(job.isActive()); + job.run(); + assertTrue(job.isActive()); + assertEquals(1, callback.eventCount); + job.run(); + assertEquals(2, callback.eventCount); + assertTrue(job.isActive()); + Thread.sleep(11); + job.run(); + assertTrue(job.isActive()); + assertTrue("expected more than 10 ms, got " + callback.activeTime, callback.activeTime > 10); + assertEquals(3, callback.eventCount); + } + + public void testResumeFromSleepTimeoutNoEvent() throws Exception { + callback.lastEventTime = System.currentTimeMillis(); + job.setInactivityTimeout(20); + job.setTick(20); + job.run(); + assertTrue(job.isActive()); + job.run(); + assertTrue(job.isActive()); + assertEquals(1, callback.eventCount); + Thread.sleep(61); + // resume from sleep past timeout + job.run(); + assertFalse(job.isActive()); + job.run(); + assertFalse(job.isActive()); + assertTrue("expected less than 10 ms, got " + callback.activeTime, callback.activeTime < 10); + assertEquals(1, callback.eventCount); + assertEquals(callback.lastEventTime, callback.startTime); + } + + public void testResumeFromSleepTimeoutEvent() throws Exception { + callback.lastEventTime = System.currentTimeMillis(); + job.setInactivityTimeout(20); + job.setTick(20); + job.run(); + assertTrue(job.isActive()); + job.run(); + assertTrue(job.isActive()); + assertEquals(1, callback.eventCount); + Thread.sleep(41); + // resume from sleep past timeout + job.run(); + assertTrue(callback.inactive); + assertFalse(job.isActive()); + Thread.sleep(11); + // should still discard events + job.run(); + assertFalse(job.isActive()); + // start activity + callback.lastEventTime = System.currentTimeMillis(); + job.run(); + assertTrue(job.isActive()); + assertEquals(1, callback.eventCount); + Thread.sleep(11); + job.run(); + // check if time sleeping was logged + long slept = System.currentTimeMillis() - callback.lastEventTime; + assertTrue("expected less than 10 < activeTime < 20, got " + callback.activeTime + " (slept " + slept + " ms)", + callback.activeTime > 10 && callback.activeTime < 20); + assertEquals(2, callback.eventCount); + } + + public void testResumeFromSleepTimeoutEventDiscarded() throws Exception { + // record one tick + callback.lastEventTime = System.currentTimeMillis(); + job.setInactivityTimeout(20); + job.setTick(20); + job.run(); + assertTrue(job.isActive()); + job.run(); + assertTrue(job.isActive()); + assertEquals(1, callback.eventCount); + // resume from sleep past timeout + callback.activeTime = 0; + Thread.sleep(61); + callback.lastEventTime = System.currentTimeMillis(); + job.run(); + assertFalse(callback.inactive); + assertTrue(job.isActive()); + assertEquals(0, callback.activeTime); + // record another tick + Thread.sleep(6); + job.run(); + long slept = System.currentTimeMillis() - callback.lastEventTime; + assertTrue(job.isActive()); + // check if time sleeping was logged + assertEquals(2, callback.eventCount); + assertTrue("expected less than 5 < activeTime < 40, got " + callback.activeTime + " (slept " + slept + " ms)", + callback.activeTime > 5 && callback.activeTime < 40); + } + + private class TestableCheckActivityJob extends MonitorUserActivityJob { + + public TestableCheckActivityJob(IUserActivityManagerCallback callback) { + super(callback); + } + + public IStatus run() { + return super.run(new NullProgressMonitor()); + } + + @Override + protected boolean isEnabled() { + return true; + } + + public void setTick(long tick) { + this.tick = tick; + } + + @Override + public void reschedule() { + // ignore, job is called explicitly from test + } + + } + + private class StubCallback implements IUserActivityManagerCallback { + + private boolean inactive; + + private long lastEventTime; + + private long activeTime; + + private long eventCount; + + private long startTime; + + public void addMonitoredActivityTime(long startTime, long endTime) { + this.startTime = startTime; + this.activeTime += endTime - startTime; + this.eventCount++; + } + + public void inactive() { + this.inactive = true; + } + + public long getLastEventTime() { + return this.lastEventTime; + } + + public void active() { + } + + } + +} diff --git a/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/UserActivityManagerTest.java b/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/UserActivityManagerTest.java new file mode 100644 index 00000000..c415a7a9 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.tests/src/org/eclipse/mylyn/commons/activity/tests/UserActivityManagerTest.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (c) 2009, 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.commons.activity.tests; + +import java.util.Arrays; + +import junit.framework.TestCase; + +import org.eclipse.mylyn.commons.activity.ui.spi.AbstractUserActivityMonitor; +import org.eclipse.mylyn.internal.commons.activity.ui.UserActivityManager; + +/** + * @author Steffen Pingel + */ +public class UserActivityManagerTest extends TestCase { + + private class StubUserActivityMonitor extends AbstractUserActivityMonitor { + + private boolean started; + + private boolean fail; + + private boolean enabled = true; + + private final int priority; + + public StubUserActivityMonitor(int priority) { + this.priority = priority; + } + + @Override + public boolean isEnabled() { + return enabled; + } + + @Override + public void start() { + started = true; + } + + @Override + public void stop() { + started = false; + } + + @Override + public long getLastInteractionTime() { + if (fail) { + throw new LinkageError(); + } + return super.getLastInteractionTime(); + } + + @Override + public int getPriority() { + return priority; + } + + } + + private StubUserActivityMonitor monitor1; + + private StubUserActivityMonitor monitor2; + + private UserActivityManager manager; + + @Override + protected void setUp() throws Exception { + monitor1 = new StubUserActivityMonitor(0); + monitor2 = new StubUserActivityMonitor(1); + manager = new UserActivityManager(Arrays.asList(new AbstractUserActivityMonitor[] { monitor1, monitor2 })); + } + + @Override + protected void tearDown() throws Exception { + if (manager != null) { + manager.stop(); + } + }; + + public void testStartStop() { + manager.start(); + assertTrue(monitor1.started); + assertTrue(monitor2.started); + manager.stop(); + assertFalse(monitor1.started); + assertFalse(monitor2.started); + } + + public void testGetInactivityTimeout() { + monitor1.setLastEventTime(1); + monitor2.setLastEventTime(2); + assertEquals(1, manager.getLastInteractionTime()); + assertEquals(1, manager.getLastInteractionTime()); + } + + public void testGetInactivityTimeoutFailure() { + monitor1.setLastEventTime(1); + monitor2.setLastEventTime(2); + manager.start(); + assertEquals(1, manager.getLastInteractionTime()); + monitor1.fail = true; + assertEquals(2, manager.getLastInteractionTime()); + manager.stop(); + // the first monitor should have been disabled + assertTrue(monitor1.started); + assertFalse(monitor2.started); + } + + public void testEnabled() { + monitor1.enabled = false; + monitor1.setLastEventTime(1); + monitor2.setLastEventTime(2); + assertEquals(2, manager.getLastInteractionTime()); + monitor2.enabled = false; + assertEquals(-1, manager.getLastInteractionTime()); + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/.classpath b/org.eclipse.mylyn.commons.activity.ui/.classpath new file mode 100644 index 00000000..41e559de --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/.classpath @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"> + <accessrules> + <accessrule kind="accessible" pattern="org/eclipse/core/internal/runtime/*"/> + </accessrules> + </classpathentry> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/org.eclipse.mylyn.commons.activity.ui/.cvsignore b/org.eclipse.mylyn.commons.activity.ui/.cvsignore new file mode 100644 index 00000000..d567ba01 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/.cvsignore @@ -0,0 +1,2 @@ +bin +target diff --git a/org.eclipse.mylyn.commons.activity.ui/.project b/org.eclipse.mylyn.commons.activity.ui/.project new file mode 100644 index 00000000..ab56b504 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.mylyn.commons.activity.ui</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> + </natures> +</projectDescription> diff --git a/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..bbaca6d6 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,357 @@ +#Wed Mar 02 16:00:06 PST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled +org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL +org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_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=48 +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_selector_in_method_invocation=80 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.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=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +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=insert +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_member=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=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_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +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_outer_expressions_when_nested=true diff --git a/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..d92dfc1c --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,63 @@ +#Wed Mar 02 16:00:08 PST 2011 +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_Mylyn based on Eclipse +formatter_settings_version=12 +internal.default.compliance=default +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\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\="true" 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 * \r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\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"/><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\r\n * Copyright (c) ${year} Tasktop Technologies and others.\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 * Tasktop Technologies - initial API and implementation\r\n *******************************************************************************/\r\n\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">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ignore\r\n${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ignore</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\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.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\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.wst.jsdt.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.wst.jsdt.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.wst.jsdt.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.wst.jsdt.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.wst.jsdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\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.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=true +sp_cleanup.correct_indentation=true +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_variable_declarations_final=true +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=true +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 00000000..5e7f2bd4 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Tue Aug 18 22:42:26 PDT 2009 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 00000000..d8c6d26a --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Mon Jun 25 03:02:37 GMT 2007 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000..e8f2d562 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/.settings/org.eclipse.pde.prefs @@ -0,0 +1,18 @@ +#Tue Apr 15 11:07:59 PDT 2008 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=2 +compilers.p.missing-bundle-classpath-entries=1 +compilers.p.missing-packages=1 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=2 +compilers.p.unknown-attribute=0 +compilers.p.unknown-class=0 +compilers.p.unknown-element=0 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=0 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/org.eclipse.mylyn.commons.activity.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.activity.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5b356e35 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: org.eclipse.mylyn.commons.activity.ui;singleton:=true +Bundle-Version: 3.7.0.qualifier +Bundle-Vendor: %Bundle-Vendor +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.eclipse.mylyn.commons.activity.ui;x-internal:=true, + org.eclipse.mylyn.commons.activity.ui.spi;x-internal:=true, + org.eclipse.mylyn.internal.commons.activity.ui;x-internal:=true +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.swt, + org.eclipse.mylyn.commons.core, + org.eclipse.jface, + org.eclipse.ui.workbench +Bundle-ClassPath: . +Bundle-Localization: plugin +Bundle-Activator: org.eclipse.mylyn.internal.commons.activity.ui.ActivityUiPlugin diff --git a/org.eclipse.mylyn.commons.activity.ui/about.html b/org.eclipse.mylyn.commons.activity.ui/about.html new file mode 100644 index 00000000..d774b07c --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/about.html @@ -0,0 +1,27 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> +<html> +<head> +<title>About</title> +<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1"> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 25, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/org.eclipse.mylyn.commons.activity.ui/build.properties b/org.eclipse.mylyn.commons.activity.ui/build.properties new file mode 100644 index 00000000..e5e8ab81 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/build.properties @@ -0,0 +1,17 @@ +############################################################################### +# Copyright (c) 2004, 2009 Tasktop Technologies and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################### + +bin.includes = about.html,\ + META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties +src.includes = about.html,\ + schema/ +jre.compilation.profile = J2SE-1.5 +source.. = src/ diff --git a/org.eclipse.mylyn.commons.activity.ui/plugin.properties b/org.eclipse.mylyn.commons.activity.ui/plugin.properties new file mode 100644 index 00000000..49e2fc18 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2011 Tasktop Technologies and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Tasktop Technologies - initial API and implementation +############################################################################### +Bundle-Vendor = Eclipse Mylyn +Bundle-Name = Mylyn Commons Activity Monitor diff --git a/org.eclipse.mylyn.commons.activity.ui/plugin.xml b/org.eclipse.mylyn.commons.activity.ui/plugin.xml new file mode 100644 index 00000000..39c7d8b0 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/plugin.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.5"?> +<!-- + Copyright (c) 2011 Tasktop Technologies and others. + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html + + Contributors: + Tasktop Technologies - initial API and implementation + --> +<plugin> + <extension-point id="userActivityMonitors" name="User Activity Monitoring" schema="schema/userActivityMonitors.exsd"/> + + <extension + point="org.eclipse.ui.preferencePages"> + <page + category="org.eclipse.mylyn.preferencePages.Mylyn" + class="org.eclipse.mylyn.internal.commons.activity.ui.ActivityUiPreferencePage" + id="org.eclipse.mylyn.monitor.ui.preferences" + name="Activity"> + </page> + </extension> + <extension + point="org.eclipse.core.runtime.preferences"> + <initializer + class="org.eclipse.mylyn.internal.commons.activity.ui.ActivityUiPreferenceInitializer"> + </initializer> + </extension> +</plugin> diff --git a/org.eclipse.mylyn.commons.activity.ui/pom.xml b/org.eclipse.mylyn.commons.activity.ui/pom.xml new file mode 100644 index 00000000..5b00119a --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/pom.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>org.eclipse.mylyn.commons-parent</artifactId> + <groupId>org.eclipse.mylyn.commons</groupId> + <version>3.7.0-SNAPSHOT</version> + </parent> + <artifactId>org.eclipse.mylyn.commons.activity.ui</artifactId> + <version>3.7.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> + <build> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-source-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + </plugin> + </plugins> + </build> +</project> diff --git a/org.eclipse.mylyn.commons.activity.ui/schema/userActivityMonitors.exsd b/org.eclipse.mylyn.commons.activity.ui/schema/userActivityMonitors.exsd new file mode 100644 index 00000000..82de2f75 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/schema/userActivityMonitors.exsd @@ -0,0 +1,95 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="org.eclipse.mylyn.monitor.ui" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appInfo> + <meta.schema plugin="org.eclipse.mylyn.monitor.ui" id="userActivityMonitors" name="User Monitoring"/> + </appInfo> + <documentation> + Provides user-specific monitor extensions, for example, for tracking periods of user activity/inactivity. + </documentation> + </annotation> + + <element name="extension"> + <annotation> + <appInfo> + <meta.element /> + </appInfo> + </annotation> + <complexType> + <sequence> + <element ref="osActivityTimer"/> + </sequence> + <attribute name="point" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="id" type="string"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="name" type="string"> + <annotation> + <documentation> + + </documentation> + <appInfo> + <meta.attribute translatable="true"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <element name="osActivityTimer"> + <annotation> + <documentation> + Only one extension is permitted per workbench instance. If more than one plug-in specifies this extension point, only one will be used. + </documentation> + </annotation> + <complexType> + <attribute name="class" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appInfo> + <meta.attribute kind="java" basedOn="org.eclipse.mylyn.monitor.ui.AbstractUserActivityMonitor:"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appInfo> + <meta.section type="since"/> + </appInfo> + <documentation> + 2.0 + </documentation> + </annotation> + + + + + <annotation> + <appInfo> + <meta.section type="copyright"/> + </appInfo> + <documentation> + Copyright (c) 2009 Tasktop Technologies and others. +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License v1.0 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl-v10.html + </documentation> + </annotation> + +</schema> diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/ActivityUi.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/ActivityUi.java new file mode 100644 index 00000000..58b185ba --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/ActivityUi.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.commons.activity.ui; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.util.IPropertyChangeListener; +import org.eclipse.mylyn.commons.activity.ui.spi.AbstractUserActivityMonitor; +import org.eclipse.mylyn.commons.core.ExtensionPointReader; +import org.eclipse.mylyn.internal.commons.activity.ui.ActivityUiPlugin; +import org.eclipse.mylyn.internal.commons.activity.ui.DefaultUserActivityMonitor; +import org.eclipse.mylyn.internal.commons.activity.ui.IActivityUiConstants; +import org.eclipse.mylyn.internal.commons.activity.ui.UserActivityManager; + +/** + * Entry point for registering listener to monitor user activity. + * + * @author Steffen Pingel + * @since 3.7 + */ +public class ActivityUi { + + private final static IPropertyChangeListener PROPERTY_LISTENER = new IPropertyChangeListener() { + public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) { + if (event.getProperty().equals(IActivityUiConstants.ACTIVITY_TIMEOUT) + || event.getProperty().equals(IActivityUiConstants.ACTIVITY_TIMEOUT_ENABLED) + || event.getProperty().equals(IActivityUiConstants.ACTIVITY_TRACKING_ENABLED)) { + updateUserActivityMonitor(); + } + } + }; + + private static UserActivityManager userActivityManager; + + /** + * Registers a user activity listener. + * + * @since 3.7 + * @param listener + * listener to add + */ + public static void addUserAttentionListener(UserActivityListener listener) { + getUserActivityMonitor().addAttentionListener(listener); + } + + /** + * Unregisters a user activity listener. + * + * @since 3.7 + * @param listener + * listener to remote + */ + public static void removeUserAttentionListener(UserActivityListener listener) { + getUserActivityMonitor().removeAttentionListener(listener); + } + + private static IPreferenceStore getPreferenceStore() { + return ActivityUiPlugin.getDefault().getPreferenceStore(); + } + + synchronized static UserActivityManager getUserActivityMonitor() { + if (userActivityManager == null) { + // create default activity monitor + List<AbstractUserActivityMonitor> items = new ArrayList<AbstractUserActivityMonitor>(); + items.add(new DefaultUserActivityMonitor()); + + // read contributed activity monitors + ExtensionPointReader<AbstractUserActivityMonitor> reader = new ExtensionPointReader<AbstractUserActivityMonitor>( + IActivityUiConstants.ID_PLUGIN, "userActivityMonitors", "osActivityTimer", //$NON-NLS-1$ //$NON-NLS-2$ + AbstractUserActivityMonitor.class); + reader.read(); + + // rank by highest priority first + items.addAll(reader.getItems()); + Collections.sort(items, new Comparator<AbstractUserActivityMonitor>() { + public int compare(AbstractUserActivityMonitor o1, AbstractUserActivityMonitor o2) { + return o2.getPriority() - o1.getPriority(); + } + }); + + getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER); + + userActivityManager = new UserActivityManager(items); + updateUserActivityMonitor(); + + // TODO only start if enabled + userActivityManager.start(); + } + return userActivityManager; + } + + synchronized static void updateUserActivityMonitor() { + if (userActivityManager == null) { + return; + } + if (getPreferenceStore().getBoolean(IActivityUiConstants.ACTIVITY_TIMEOUT_ENABLED)) { + userActivityManager.setInactivityTimeout(getPreferenceStore().getInt(IActivityUiConstants.ACTIVITY_TIMEOUT)); + } else { + userActivityManager.setInactivityTimeout(0); + } + // TODO stop if disabled + } + + public static boolean isActivityTrackingEnabled() { + return getPreferenceStore().getBoolean(IActivityUiConstants.ACTIVITY_TRACKING_ENABLED); + } + + public synchronized static boolean isTrackingOsTime() { + if (userActivityManager == null) { + return false; + } + return userActivityManager.isTrackingOsTime(); + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/UserActivityListener.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/UserActivityListener.java new file mode 100644 index 00000000..7653d0b7 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/UserActivityListener.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ +package org.eclipse.mylyn.commons.activity.ui; + +/** + * Notified of user activity and inactivity events. + * + * @author Mik Kersten + * @since 3.7 + */ +public abstract class UserActivityListener { + + /** + * Invoked when the user becomes active. + * + * @since 3.7 + */ + public abstract void userAttentionGained(); + + /** + * Invoked when the user becomes inactive. + * + * @since 3.7 + */ + public abstract void userAttentionLost(); + + /** + * Invoked when the user activity is recorded over a period of time. + * + * @param start + * time in milliseconds when user activity started + * @param end + * time in milliseconds when user activity ended + * @since 3.7 + */ + public abstract void userActive(long start, long end); + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/spi/AbstractUserActivityMonitor.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/spi/AbstractUserActivityMonitor.java new file mode 100644 index 00000000..8432f4f3 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/commons/activity/ui/spi/AbstractUserActivityMonitor.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2004, 2008 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ +package org.eclipse.mylyn.commons.activity.ui.spi; + +/** + * Extend to monitor periods of user activity and inactivity. + * + * @author Mik Kersten + * @author Rob Elves + * @since 3.7 + */ +public abstract class AbstractUserActivityMonitor { + + private long lastEventTimeStamp = -1; + + /** + * Returns the priority of the monitor. A lower priority means that the monitor is preferred over other monitors. + * The priority of the default monitor is <code>0</code>. + * + * @since 3.7 + */ + public abstract int getPriority(); + + /** + * @since 3.7 + */ + public long getLastInteractionTime() { + synchronized (this) { + return lastEventTimeStamp; + } + } + + /** + * @since 3.7 + */ + public void setLastEventTime(long lastEventTime) { + synchronized (this) { + lastEventTimeStamp = lastEventTime; + } + } + + /** + * @since 3.7 + */ + public abstract void start(); + + /** + * @since 3.7 + */ + public abstract void stop(); + + /** + * @return false if monitor unable to run (i.e. startup failures of any kind) + * @since 3.7 + */ + public boolean isEnabled() { + return true; + } + + /** + * @since 3.7 + */ + public String getOriginId() { + return null; + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPlugin.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPlugin.java new file mode 100644 index 00000000..8859758f --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPlugin.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * @author Steffen Pingel + */ +public class ActivityUiPlugin extends AbstractUIPlugin { + + private static ActivityUiPlugin instance; + + public static ActivityUiPlugin getDefault() { + return instance; + } + + @Override + public void start(BundleContext context) throws Exception { + instance = this; + super.start(context); + } + + @Override + public void stop(BundleContext context) throws Exception { + super.stop(context); + instance = null; + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPreferenceInitializer.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPreferenceInitializer.java new file mode 100644 index 00000000..fde4bcec --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPreferenceInitializer.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.ui.preferences.ScopedPreferenceStore; + +/** + * @author Steffen Pingel + */ +public class ActivityUiPreferenceInitializer extends AbstractPreferenceInitializer { + + private static final String ACTIVITY_PREFS_MIGRATED = "org.eclipse.mylyn.activity.ui.migrated"; //$NON-NLS-1$ + + @Override + public void initializeDefaultPreferences() { + IPreferenceStore prefs = ActivityUiPlugin.getDefault().getPreferenceStore(); + prefs.setDefault(IActivityUiConstants.ACTIVITY_TIMEOUT, IActivityUiConstants.DEFAULT_ACTIVITY_TIMEOUT); + prefs.setDefault(IActivityUiConstants.ACTIVITY_TIMEOUT_ENABLED, true); + prefs.setDefault(IActivityUiConstants.ACTIVITY_TRACKING_ENABLED, false); + + if (!prefs.getBoolean(ACTIVITY_PREFS_MIGRATED)) { + prefs.setValue(ACTIVITY_PREFS_MIGRATED, true); + + // migrate values from preferences store in org.eclipse.mylyn.monitor.ui + @SuppressWarnings("deprecation") + ScopedPreferenceStore oldPrefs = new ScopedPreferenceStore(new InstanceScope(), + "org.eclipse.mylyn.monitor.ui"); //$NON-NLS-1$ + int intValue = oldPrefs.getInt("org.eclipse.mylyn.monitor.ui.activity.timeout"); //$NON-NLS-1$ + if (intValue != 180000) { + prefs.setValue(IActivityUiConstants.ACTIVITY_TIMEOUT, intValue); + } + + boolean booleanValue = oldPrefs.getBoolean("org.eclipse.mylyn.monitor.ui.activity.timeout.enabled"); //$NON-NLS-1$ + if (booleanValue != true) { + prefs.setValue(IActivityUiConstants.ACTIVITY_TIMEOUT_ENABLED, booleanValue); + } + + booleanValue = oldPrefs.getBoolean("org.eclipse.mylyn.monitor.activity.tracking.enabled"); //$NON-NLS-1$ + if (booleanValue != false) { + prefs.setValue(IActivityUiConstants.ACTIVITY_TRACKING_ENABLED, booleanValue); + } + } + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPreferencePage.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPreferencePage.java new file mode 100644 index 00000000..0c7499df --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/ActivityUiPreferencePage.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Spinner; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +/** + * @author Mik Kersten + * @author Rob Elves + * @author Steffen Pingel + */ +public class ActivityUiPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { + + private static final int MS_MINUTES = 60 * 1000; + + private Spinner timeoutMinutes; + + private Button timeoutEnabledButton; + + private Button activityTrackingEnabledButton; + + private Label timeoutLabel1; + + private Label timeoutLabel2; + + public ActivityUiPreferencePage() { + setPreferenceStore(ActivityUiPlugin.getDefault().getPreferenceStore()); + } + + @Override + protected Control createContents(Composite parent) { + Composite container = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(1, false); + container.setLayout(layout); + + createTaskActivityGroup(container); + + updateControls(); + applyDialogFont(container); + return container; + } + + public void init(IWorkbench workbench) { + // ignore + } + + @Override + public boolean performOk() { + getPreferenceStore().setValue(IActivityUiConstants.ACTIVITY_TIMEOUT_ENABLED, + timeoutEnabledButton.getSelection()); + getPreferenceStore().setValue(IActivityUiConstants.ACTIVITY_TIMEOUT, + timeoutMinutes.getSelection() * (60 * 1000)); + getPreferenceStore().setValue(IActivityUiConstants.ACTIVITY_TRACKING_ENABLED, + activityTrackingEnabledButton.getSelection()); + return true; + } + + @Override + public boolean performCancel() { + int minutes = getPreferenceStore().getInt(IActivityUiConstants.ACTIVITY_TIMEOUT) / MS_MINUTES; + timeoutMinutes.setSelection(minutes); + timeoutEnabledButton.setSelection(getPreferenceStore().getBoolean(IActivityUiConstants.ACTIVITY_TIMEOUT_ENABLED)); + activityTrackingEnabledButton.setSelection(getPreferenceStore().getBoolean( + IActivityUiConstants.ACTIVITY_TRACKING_ENABLED)); + return true; + } + + @Override + public void performDefaults() { + super.performDefaults(); + int activityTimeoutMinutes = getPreferenceStore().getDefaultInt(IActivityUiConstants.ACTIVITY_TIMEOUT) + / MS_MINUTES; + timeoutMinutes.setSelection(activityTimeoutMinutes); + timeoutEnabledButton.setSelection(getPreferenceStore().getDefaultBoolean( + IActivityUiConstants.ACTIVITY_TIMEOUT_ENABLED)); + + activityTrackingEnabledButton.setSelection(getPreferenceStore().getDefaultBoolean( + IActivityUiConstants.ACTIVITY_TRACKING_ENABLED)); + } + + private Group createTaskActivityGroup(Composite container) { + Group group = new Group(container, SWT.SHADOW_ETCHED_IN); + group.setText(Messages.TasksUiPreferencePage_Task_Timing); + group.setLayout(new GridLayout(3, false)); + group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + boolean activityTrackingEnabled = getPreferenceStore().getBoolean( + IActivityUiConstants.ACTIVITY_TRACKING_ENABLED); + + boolean timeoutEnabled = getPreferenceStore().getBoolean(IActivityUiConstants.ACTIVITY_TIMEOUT_ENABLED); + + activityTrackingEnabledButton = new Button(group, SWT.CHECK); + activityTrackingEnabledButton.setText(Messages.TasksUiPreferencePage_Enable_Time_Tracking); + activityTrackingEnabledButton.setSelection(activityTrackingEnabled); + activityTrackingEnabledButton.setToolTipText(Messages.TasksUiPreferencePage_Track_Time_Spent); + activityTrackingEnabledButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + updateControls(); + } + }); + GridDataFactory.swtDefaults().span(3, 1).applyTo(activityTrackingEnabledButton); + + timeoutEnabledButton = new Button(group, SWT.CHECK); + timeoutEnabledButton.setText(Messages.TasksUiPreferencePage_Enable_inactivity_timeouts); + timeoutEnabledButton.setSelection(timeoutEnabled); + timeoutEnabledButton.setToolTipText(Messages.TasksUiPreferencePage_If_disabled); + timeoutEnabledButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + updateControls(); + } + }); + GridDataFactory.swtDefaults().span(3, 1).applyTo(timeoutEnabledButton); + + timeoutLabel1 = new Label(group, SWT.NONE); + timeoutLabel1.setText(Messages.TasksUiPreferencePage_Stop_time_accumulation_after); + timeoutMinutes = new Spinner(group, SWT.BORDER); + timeoutMinutes.setDigits(0); + timeoutMinutes.setIncrement(5); + timeoutMinutes.setMaximum(60); + timeoutMinutes.setMinimum(1); + long minutes = getPreferenceStore().getLong(IActivityUiConstants.ACTIVITY_TIMEOUT) / MS_MINUTES; + timeoutMinutes.setSelection((int) minutes); + timeoutMinutes.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + updateControls(); + } + + }); + + timeoutLabel2 = new Label(group, SWT.NONE); + timeoutLabel2.setText(Messages.TasksUiPreferencePage_minutes_of_inactivity); + + return group; + } + + public void updateControls() { + if (activityTrackingEnabledButton.getSelection()) { + timeoutEnabledButton.setEnabled(true); + timeoutMinutes.setEnabled(timeoutEnabledButton.getSelection()); + timeoutLabel1.setEnabled(timeoutEnabledButton.getSelection()); + timeoutLabel2.setEnabled(timeoutEnabledButton.getSelection()); + } else { + timeoutEnabledButton.setEnabled(false); + timeoutMinutes.setEnabled(false); + timeoutLabel1.setEnabled(false); + timeoutLabel2.setEnabled(false); + } + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/DefaultUserActivityMonitor.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/DefaultUserActivityMonitor.java new file mode 100644 index 00000000..1f48edf6 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/DefaultUserActivityMonitor.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +import org.eclipse.mylyn.commons.activity.ui.spi.AbstractUserActivityMonitor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; + +/** + * @author Mik Kersten + * @author Rob Elves + */ +public class DefaultUserActivityMonitor extends AbstractUserActivityMonitor { + + private Listener interactionActivityListener; + + private Display display; + + public DefaultUserActivityMonitor() { + } + + @Override + public void start() { + display = Display.getDefault(); + interactionActivityListener = new Listener() { + public void handleEvent(Event event) { + setLastEventTime(System.currentTimeMillis()); + } + }; + + display.addFilter(SWT.KeyUp, interactionActivityListener); + display.addFilter(SWT.MouseUp, interactionActivityListener); + } + + @Override + public void stop() { + if (display != null && !display.isDisposed() && interactionActivityListener != null) { + display.removeFilter(SWT.KeyUp, interactionActivityListener); + display.removeFilter(SWT.MouseUp, interactionActivityListener); + } + } + + @Override + public int getPriority() { + return 0; + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IActivityUiConstants.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IActivityUiConstants.java new file mode 100644 index 00000000..b4185a1b --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IActivityUiConstants.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +/** + * @author Steffen Pingel + */ +public interface IActivityUiConstants { + + public static final String ID_PLUGIN = "org.eclipes.mylyn.commons.activity.ui"; //$NON-NLS-1$ + + public static final String ACTIVITY_TIMEOUT = "org.eclipse.mylyn.activity.ui.timeout"; //$NON-NLS-1$ + + public static final String ACTIVITY_TIMEOUT_ENABLED = "org.eclipse.mylyn..activity.ui.timeout.enabled"; //$NON-NLS-1$ + + public static final String ACTIVITY_TRACKING_ENABLED = "org.eclipse.mylyn.activity.ui.tracking.enabled"; //$NON-NLS-1$ + + public static final int DEFAULT_ACTIVITY_TIMEOUT = 180000; + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IUserActivityManager.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IUserActivityManager.java new file mode 100644 index 00000000..f3e70cda --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IUserActivityManager.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +import org.eclipse.mylyn.commons.activity.ui.UserActivityListener; + +/** + * @noextend This class is not intended to be subclassed by clients. + * @noimplement This interface is not intended to be implemented by clients. + * @author Steffen Pingel + */ +public interface IUserActivityManager { + + public void addAttentionListener(UserActivityListener listener); + + public void removeAttentionListener(UserActivityListener listener); + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IUserActivityManagerCallback.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IUserActivityManagerCallback.java new file mode 100644 index 00000000..9f3d0348 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/IUserActivityManagerCallback.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2004, 2008 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +public interface IUserActivityManagerCallback { + + public abstract void inactive(); + + public abstract void active(); + + public abstract void addMonitoredActivityTime(long localStartTime, long currentTime); + + public abstract long getLastEventTime(); + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/Messages.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/Messages.java new file mode 100644 index 00000000..9a543eea --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/Messages.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2004, 2008 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + + private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.monitor.ui.messages"; //$NON-NLS-1$ + + static { + // load message values from bundle file + reloadMessages(); + } + + public static void reloadMessages() { + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + public static String CheckActivityJob_Activity_Monitor_Job; + + public static String TasksUiPreferencePage_Enable_inactivity_timeouts; + + public static String TasksUiPreferencePage_Enable_Time_Tracking; + + public static String TasksUiPreferencePage_If_disabled; + + public static String TasksUiPreferencePage_minutes_of_inactivity; + + public static String TasksUiPreferencePage_Stop_time_accumulation_after; + + public static String TasksUiPreferencePage_Task_Timing; + + public static String TasksUiPreferencePage_Track_Time_Spent; + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/MonitorUserActivityJob.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/MonitorUserActivityJob.java new file mode 100644 index 00000000..d1130d62 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/MonitorUserActivityJob.java @@ -0,0 +1,148 @@ +/******************************************************************************* + * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.internal.commons.activity.ui; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.mylyn.commons.core.StatusHandler; + +/** + * A job that is scheduled periodically to check for user activity. + * + * @author Robert Elves + * @author Steffen Pingel + */ +public class MonitorUserActivityJob extends Job { + + /** + * If true, the user is assumed to be active. + */ + private boolean active; + + /** + * The rescheduling interval in ms when active. Should be reasonably short to provide accurate tracking. + */ + private final int ACTIVE_TICK = 30 * 1000; + + private final IUserActivityManagerCallback callback; + + /** + * The timeout when to assume a user is inactive. If set to 0 it is assumed that a user is always active. + */ + private int inactivityTimeout; + + protected long previousEventTime; + + /** + * Protected for testing. + */ + protected long tick = ACTIVE_TICK; + + volatile boolean errorLogged; + + public MonitorUserActivityJob(IUserActivityManagerCallback callback) { + super(Messages.CheckActivityJob_Activity_Monitor_Job); + this.callback = callback; + } + + public int getInactivityTimeout() { + return this.inactivityTimeout; + } + + public boolean isActive() { + return active; + } + + protected boolean isEnabled() { + return Platform.isRunning() /* && !PlatformUI.getWorkbench().isClosing() */; + } + + /** + * Uses a short interval when inactive. This makes event notifications more accurate when switching from an inactive + * to an active state, e.g. to ensure lively updates of the UI. + */ + public void reschedule() { + schedule(active ? tick : tick / 6); + } + + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + if (isEnabled()) { + try { + long lastEventTime = callback.getLastEventTime(); + long currentTime = System.currentTimeMillis(); + // check if the last activity exceeds timeout + if ((currentTime - lastEventTime) >= inactivityTimeout && inactivityTimeout != 0) { + if (active) { + // time out + active = false; + callback.inactive(); + } + } else { + if (!active) { + active = true; + // back, start recording activity + if (inactivityTimeout != 0) { + previousEventTime = lastEventTime; + } else { + // if timeouts are disabled only the currentTime is relevant for tracking activity + previousEventTime = currentTime; + } + callback.active(); + } else { + // check if the activity internal is unreasonably long, it is likely that + // the computer came back from sleep at worst difference should be tick * 2 + if (currentTime - previousEventTime > tick * 3) { + if (inactivityTimeout != 0) { + // check for recent event + if (currentTime - lastEventTime <= tick) { + // event since resume + previousEventTime = lastEventTime; + } else { + // time out + active = false; + callback.inactive(); + } + } else { + // if timeouts are disabled only the currentTime is relevant for tracking activity + previousEventTime = currentTime; + } + } else { + callback.addMonitoredActivityTime(previousEventTime, currentTime); + previousEventTime = currentTime; + } + } + } + } finally { + reschedule(); + } + } + } catch (Throwable t) { + // this job runs frequently and should never cause error popups + if (!errorLogged) { + StatusHandler.log(new Status(IStatus.ERROR, IActivityUiConstants.ID_PLUGIN, + "An error occured while processing events", t)); //$NON-NLS-1$ + errorLogged = true; + } + } + return Status.OK_STATUS; + } + + public void setInactivityTimeout(int inactivityTimeout) { + this.inactivityTimeout = inactivityTimeout; + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/UserActivityManager.java b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/UserActivityManager.java new file mode 100644 index 00000000..6d60b744 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/UserActivityManager.java @@ -0,0 +1,182 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ +package org.eclipse.mylyn.internal.commons.activity.ui; + +import java.util.List; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.CopyOnWriteArraySet; + +import org.eclipse.core.runtime.ISafeRunnable; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.SafeRunner; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.mylyn.commons.activity.ui.UserActivityListener; +import org.eclipse.mylyn.commons.activity.ui.spi.AbstractUserActivityMonitor; +import org.eclipse.mylyn.commons.core.StatusHandler; +import org.eclipse.osgi.util.NLS; + +/** + * Monitors user activity and notifies listeners. + * + * @author Steffen Pingel + */ +public class UserActivityManager implements IUserActivityManager { + + private final Set<UserActivityListener> activityListeners; + + private final List<AbstractUserActivityMonitor> activityMonitors; + + private final MonitorUserActivityJob monitorJob; + + public UserActivityManager(List<AbstractUserActivityMonitor> monitors) { + this.activityListeners = new CopyOnWriteArraySet<UserActivityListener>(); + this.activityMonitors = new CopyOnWriteArrayList<AbstractUserActivityMonitor>(monitors); + this.monitorJob = createMonitorActivityJob(); + } + + public void addAttentionListener(UserActivityListener listener) { + activityListeners.add(listener); + } + + public int getInactivityTimeout() { + return monitorJob.getInactivityTimeout(); + } + + public long getLastInteractionTime() { + for (final AbstractUserActivityMonitor monitor : activityMonitors) { + final boolean[] success = new boolean[1]; + final long[] result = new long[1]; + SafeRunner.run(new ISafeRunnable() { + public void handleException(Throwable e) { + disableFailedMonitor(monitor, e); + } + + public void run() throws Exception { + if (monitor.isEnabled()) { + result[0] = monitor.getLastInteractionTime(); + success[0] = true; + } + } + }); + if (success[0]) { + return result[0]; + } + } + return -1; + } + + /** + * Returns true, if other activity monitors than {@link WorkbenchUserActivityMonitor} have been registered. + */ + public boolean isTrackingOsTime() { + return activityMonitors.size() > 1; + } + + public void removeAttentionListener(UserActivityListener listener) { + activityListeners.remove(listener); + } + + public void setInactivityTimeout(int inactivityTimeout) { + monitorJob.setInactivityTimeout(inactivityTimeout); + } + + public void start() { + for (final AbstractUserActivityMonitor monitor : activityMonitors) { + SafeRunner.run(new ISafeRunnable() { + public void handleException(Throwable e) { + disableFailedMonitor(monitor, e); + } + + public void run() throws Exception { + monitor.start(); + } + }); + } + monitorJob.reschedule(); + } + + public void stop() { + monitorJob.cancel(); + for (final AbstractUserActivityMonitor monitor : activityMonitors) { + SafeRunner.run(new ISafeRunnable() { + public void handleException(Throwable e) { + disableFailedMonitor(monitor, e); + } + + public void run() throws Exception { + monitor.stop(); + } + }); + } + } + + private MonitorUserActivityJob createMonitorActivityJob() { + MonitorUserActivityJob job = new MonitorUserActivityJob(new IUserActivityManagerCallback() { + public void active() { + UserActivityManager.this.fireActive(); + } + + public void addMonitoredActivityTime(long localStartTime, long currentTime) { + UserActivityManager.this.fireMonitoredActivityTime(localStartTime, currentTime); + } + + public long getLastEventTime() { + return UserActivityManager.this.getLastInteractionTime(); + } + + public void inactive() { + UserActivityManager.this.fireInactive(); + } + }); + job.setSystem(true); + job.setPriority(Job.INTERACTIVE); + return job; + } + + private void disableFailedMonitor(AbstractUserActivityMonitor monitor, Throwable e) { + StatusHandler.log(new Status(IStatus.WARNING, IActivityUiConstants.ID_PLUGIN, NLS.bind( + "Activity monitor ''{0}'' was disabled due to a failure", monitor.getClass()), e)); //$NON-NLS-1$ + activityMonitors.remove(monitor); + } + + private void fireActive() { + for (UserActivityListener attentionListener : activityListeners) { + attentionListener.userAttentionGained(); + } + } + + private void fireInactive() { + for (UserActivityListener attentionListener : activityListeners) { + attentionListener.userAttentionLost(); + } + } + + /** + * Invoked when activity is recorded. + * + * @param start + * time in milliseconds when user activity started + * @param end + * time in milliseconds when user activity ended + */ + private void fireMonitoredActivityTime(long start, long end) { + for (UserActivityListener attentionListener : activityListeners) { + attentionListener.userActive(start, end); + } + } + + void init(List<AbstractUserActivityMonitor> monitors) { + this.activityMonitors.addAll(monitors); + } + +} diff --git a/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/messages.properties b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/messages.properties new file mode 100644 index 00000000..fa161652 --- /dev/null +++ b/org.eclipse.mylyn.commons.activity.ui/src/org/eclipse/mylyn/internal/commons/activity/ui/messages.properties @@ -0,0 +1,19 @@ +############################################################################### +# Copyright (c) 2009 Tasktop Technologies and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Tasktop Technologies - initial API and implementation +############################################################################### +CheckActivityJob_Activity_Monitor_Job=Activity Monitor Job + +TasksUiPreferencePage_Enable_inactivity_timeouts=Enable inactivity timeouts +TasksUiPreferencePage_Enable_Time_Tracking=Track time spent within Eclipse when a task is active +TasksUiPreferencePage_If_disabled=If disabled, time accumulates while a task is active with no timeout due to inactivity. +TasksUiPreferencePage_minutes_of_inactivity=minutes of inactivity. +TasksUiPreferencePage_Stop_time_accumulation_after=Stop time accumulation after +TasksUiPreferencePage_Task_Timing=Time Tracking +TasksUiPreferencePage_Track_Time_Spent=Track time spent within Eclipse when a task is active @@ -43,6 +43,8 @@ <modules> <module>org.eclipse.mylyn.commons-feature</module> <module>org.eclipse.mylyn.commons-site</module> + <module>org.eclipse.mylyn.commons.activity.tests</module> + <module>org.eclipse.mylyn.commons.activity.ui</module> <module>org.eclipse.mylyn.commons.core</module> <module>org.eclipse.mylyn.commons.http</module> <module>org.eclipse.mylyn.commons.identity</module> |