diff options
author | spingel | 2008-04-18 21:20:56 +0000 |
---|---|---|
committer | spingel | 2008-04-18 21:20:56 +0000 |
commit | 73a22a9421d33160ed3b96e64fd7f503599cbf8b (patch) | |
tree | 7ead048ae61883b85f7bc6d06a89d5ff42fcde1e | |
parent | 947464379423a02059c5089bcb2fe378280ac488 (diff) | |
download | org.eclipse.mylyn.tasks-73a22a9421d33160ed3b96e64fd7f503599cbf8b.tar.gz org.eclipse.mylyn.tasks-73a22a9421d33160ed3b96e64fd7f503599cbf8b.tar.xz org.eclipse.mylyn.tasks-73a22a9421d33160ed3b96e64fd7f503599cbf8b.zip |
NEW - bug 217725: [api] review plug-in and feature dependencies
https://bugs.eclipse.org/bugs/show_bug.cgi?id=217725
37 files changed, 2323 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/plugin.xml b/org.eclipse.mylyn.bugzilla.ui/plugin.xml index 039ebefa1..3be9889a3 100644 --- a/org.eclipse.mylyn.bugzilla.ui/plugin.xml +++ b/org.eclipse.mylyn.bugzilla.ui/plugin.xml @@ -72,4 +72,14 @@ </perspectiveExtension> </extension> + + <extension + point="org.eclipse.mylyn.tasks.ui.duplicateDetectors"> + <detector + class="org.eclipse.mylyn.internal.bugzilla.ui.StackTraceDuplicateDetector" + kind="bugzilla" + name="Stack Trace"> + </detector> + </extension> + </plugin> diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/StackTraceDuplicateDetector.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/StackTraceDuplicateDetector.java new file mode 100644 index 000000000..b1f240a09 --- /dev/null +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/StackTraceDuplicateDetector.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2003, 2007 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 + *******************************************************************************/ +package org.eclipse.mylyn.internal.bugzilla.ui; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery; +import org.eclipse.mylyn.monitor.core.StatusHandler; +import org.eclipse.mylyn.tasks.core.RepositoryTaskData; +import org.eclipse.mylyn.tasks.core.TaskRepository; +import org.eclipse.mylyn.tasks.ui.AbstractDuplicateDetector; +import org.eclipse.mylyn.tasks.ui.TaskFactory; +import org.eclipse.mylyn.tasks.ui.TasksUi; +import org.eclipse.mylyn.tasks.ui.editors.AbstractNewRepositoryTaskEditor; +import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector; + +/** + * @author Meghan Allen + */ +public class StackTraceDuplicateDetector extends AbstractDuplicateDetector { + + private static final int DESCRIPTION_MAX_CHARS = 6000; + + private static final String NO_STACK_MESSAGE = "Unable to locate a stack trace in the description text."; + + @Override + public SearchHitCollector getSearchHitCollector(TaskRepository repository, RepositoryTaskData taskData) { + String queryUrl = ""; + String searchString = AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(taskData.getDescription()); + if (searchString != null && searchString.length() > DESCRIPTION_MAX_CHARS) { + searchString = searchString.substring(0, DESCRIPTION_MAX_CHARS); + } + + if (searchString == null) { + MessageDialog.openWarning(null, "No Stack Trace Found", NO_STACK_MESSAGE); + return null; + } + + try { + queryUrl = repository.getRepositoryUrl() + "/buglist.cgi?long_desc_type=allwordssubstr&long_desc=" + + URLEncoder.encode(searchString, repository.getCharacterEncoding()); + } catch (UnsupportedEncodingException e) { + StatusHandler.log(new Status(IStatus.WARNING, BugzillaUiPlugin.PLUGIN_ID, "Error during duplicate detection", e)); + return null; + } + + queryUrl += "&product=" + taskData.getProduct(); + + BugzillaRepositoryQuery bugzillaQuery = new BugzillaRepositoryQuery(repository.getRepositoryUrl(), queryUrl, "search"); + + SearchHitCollector collector = new SearchHitCollector(TasksUi.getTaskListManager().getTaskList(), + repository, bugzillaQuery, new TaskFactory(repository, false, false)); + return collector; + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/.classpath b/org.eclipse.mylyn.tasks.bugs/.classpath new file mode 100644 index 000000000..b07f119d9 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.classpath @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"> + <accessrules> + <accessrule kind="accessible" pattern="org/eclipse/ui/internal/views/log/*"/> + </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.tasks.bugs/.cvsignore b/org.eclipse.mylyn.tasks.bugs/.cvsignore new file mode 100644 index 000000000..ba077a403 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.cvsignore @@ -0,0 +1 @@ +bin diff --git a/org.eclipse.mylyn.tasks.bugs/.project b/org.eclipse.mylyn.tasks.bugs/.project new file mode 100644 index 000000000..dfca76441 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.mylyn.tasks.bugs</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.tasks.bugs/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..aa9e9b46f --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,329 @@ +#Sat Mar 01 02:52:50 PST 2008 +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=disabled +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.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.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=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.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +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.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,NORMAL +org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,API +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..930f295fa --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,12 @@ +#Sat Mar 01 13:22:45 PST 2008 +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Mylyn based on Eclipse +formatter_settings_version=11 +internal.default.compliance=default +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\n * Copyright (c) 2004, 2007 Mylyn project committers and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *******************************************************************************/\n\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ignore\n${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ignore</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> diff --git a/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 000000000..7ab03bdac --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Fri Jun 02 15:30:09 PDT 2006 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=true diff --git a/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.mylar.tasklist.prefs b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.mylar.tasklist.prefs new file mode 100644 index 000000000..a6cf96a98 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.mylar.tasklist.prefs @@ -0,0 +1,4 @@ +#Fri Oct 20 16:54:30 PDT 2006 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.mylyn.tasklist.prefs b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.mylyn.tasklist.prefs new file mode 100644 index 000000000..0a2cc0b30 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.mylyn.tasklist.prefs @@ -0,0 +1,4 @@ +#Mon Jun 18 17:14:59 PDT 2007 +eclipse.preferences.version=1 +project.repository.kind=bugzilla +project.repository.url=https\://bugs.eclipse.org/bugs diff --git a/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 000000000..d8c6d26af --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.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.tasks.bugs/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.tasks.bugs/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..e8f2d5620 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/.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.tasks.bugs/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.bugs/META-INF/MANIFEST.MF new file mode 100644 index 000000000..fe6798e65 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Mylyn Bug Reporting +Bundle-SymbolicName: org.eclipse.mylyn.tasks.bugs;singleton:=true +Bundle-Version: 3.0.0.qualifier +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.ui, + org.eclipse.ui.views.log, + org.eclipse.mylyn.monitor.core;bundle-version="[3.0.0,4.0.0)", + org.eclipse.mylyn.tasks.core;bundle-version="[3.0.0,4.0.0)", + org.eclipse.mylyn.tasks.ui;bundle-version="[3.0.0,4.0.0)" +Bundle-Vendor: Eclipse.org +Bundle-ClassPath: . +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.eclipse.mylyn.internal.tasks.bugs;x-internal:=true, + org.eclipse.mylyn.internal.tasks.bugs.actions;x-internal:=true, + org.eclipse.mylyn.internal.tasks.bugs.wizards;x-internal:=true, + org.eclipse.mylyn.tasks.bugs +Bundle-Localization: plugin +Bundle-ActivationPolicy: lazy +Bundle-Activator: org.eclipse.mylyn.internal.tasks.bugs.TasksBugsPlugin diff --git a/org.eclipse.mylyn.tasks.bugs/about.html b/org.eclipse.mylyn.tasks.bugs/about.html new file mode 100644 index 000000000..0dd939c09 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/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 7, 2007</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.tasks.bugs/build.properties b/org.eclipse.mylyn.tasks.bugs/build.properties new file mode 100644 index 000000000..fed91036f --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/build.properties @@ -0,0 +1,23 @@ +############################################################################### +# Copyright (c) 2005, 2007 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/,\ + plugin.xml,\ + about.html,\ + .,\ + icons/,\ + plugin.properties,\ + build.properties +src.includes = src/,\ + plugin.xml,\ + META-INF/,\ + about.html,\ + icons/,\ + build.properties,\ + plugin.properties +jre.compilation.profile = J2SE-1.5 +source.. = src/ diff --git a/org.eclipse.mylyn.tasks.bugs/icons/etool16/report-bug.gif b/org.eclipse.mylyn.tasks.bugs/icons/etool16/report-bug.gif Binary files differnew file mode 100644 index 000000000..f88ff0a0c --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/icons/etool16/report-bug.gif diff --git a/org.eclipse.mylyn.tasks.bugs/icons/etool16/task-repository-new.gif b/org.eclipse.mylyn.tasks.bugs/icons/etool16/task-repository-new.gif Binary files differnew file mode 100644 index 000000000..5f3396137 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/icons/etool16/task-repository-new.gif diff --git a/org.eclipse.mylyn.tasks.bugs/plugin.properties b/org.eclipse.mylyn.tasks.bugs/plugin.properties new file mode 100644 index 000000000..aba0d9c7a --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/plugin.properties @@ -0,0 +1,4 @@ +#Properties file for org.eclipse.mylyn.bugzilla.ide +Bundle-Vendor.0 = Eclipse.org +Bundle-Name.0 = Mylyn Bugzilla Connector IDE +action.label.0 = Report as Bug
\ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.bugs/plugin.xml b/org.eclipse.mylyn.tasks.bugs/plugin.xml new file mode 100644 index 000000000..bd0e403be --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/plugin.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> +<plugin> + <extension-point id="pluginRepositoryMappings" name="Plug-in to Repository Mappings" schema="schema/pluginRepositoryMappings.exsd"/> + <extension-point id="taskContributors" name="Task Contributors" schema="schema/taskContributors.exsd"/> + + <extension point="org.eclipse.ui.popupMenus"> + <objectContribution + adaptable="false" + id="org.eclipse.mylyn.tasks.bugs.objectContribution" + objectClass="org.eclipse.ui.internal.views.log.LogEntry"> + <action + class="org.eclipse.mylyn.internal.tasks.bugs.actions.NewTaskFromErrorAction" + enablesFor="1" + icon="icons/etool16/task-repository-new.gif" + menubarPath="org.eclipse.pde.runtime.LogView" + id="org.eclipse.mylyn.tasklist.actions.newTaskFromErrorLog" + label="Report as Bug"> + </action> + </objectContribution> + </extension> + + <extension + point="org.eclipse.mylyn.monitor.core.errorReporters"> + <errorReporter + class="org.eclipse.mylyn.internal.tasks.bugs.TaskErrorReporter" + id="org.eclipse.mylyn.tasks.bugs.errorReporter" + label="Report Error as Bug"> + </errorReporter> + </extension> + + <extension point="org.eclipse.ui.actionSets"> + <actionSet + id="org.eclipse.mylyn.doc.actionSet" + label="Mylyn Help" + visible="true"> + <action + class="org.eclipse.mylyn.internal.tasks.bugs.actions.ReportBugAction" + icon="icons/etool16/report-bug.gif" + id="org.eclipse.mylyn.tasks.ui.bug.report" + label="Report Bug or Enhancement..." + menubarPath="help/helpStart" + style="push" + tooltip="Report Bug or Enhancement"/> + </actionSet> + </extension> + +</plugin> diff --git a/org.eclipse.mylyn.tasks.bugs/schema/pluginRepositoryMappings.exsd b/org.eclipse.mylyn.tasks.bugs/schema/pluginRepositoryMappings.exsd new file mode 100644 index 000000000..6cde80b3d --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/schema/pluginRepositoryMappings.exsd @@ -0,0 +1,101 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="org.eclipse.mylyn.bugzilla.ide" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appinfo> + <meta.schema plugin="org.eclipse.mylyn.bugzilla.ide" id="pluginRepositoryMappings" name="Plug-in to Repository Mappings"/> + </appinfo> + <documentation> + [Enter description of this extension point.] + </documentation> + </annotation> + + <element name="extension"> + <complexType> + <sequence> + <element ref="mapping" minOccurs="1" maxOccurs="unbounded"/> + </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="mapping"> + <complexType> + <sequence> + <element ref="attributes"/> + </sequence> + <attribute name="pluginIdPrefix" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + </complexType> + </element> + + <element name="attributes" type="string"> + </element> + + <annotation> + <appinfo> + <meta.section type="since"/> + </appinfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="examples"/> + </appinfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="apiInfo"/> + </appinfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + + <annotation> + <appinfo> + <meta.section type="implementation"/> + </appinfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + +</schema> diff --git a/org.eclipse.mylyn.tasks.bugs/schema/taskContributors.exsd b/org.eclipse.mylyn.tasks.bugs/schema/taskContributors.exsd new file mode 100644 index 000000000..5e62e4848 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/schema/taskContributors.exsd @@ -0,0 +1,104 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="org.eclipse.mylyn.bugzilla.ide" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appinfo> + <meta.schema plugin="org.eclipse.mylyn.bugzilla.ide" id="taskContributors" name="Task Contributors"/> + </appinfo> + <documentation> + [Enter description of this extension point.] + </documentation> + </annotation> + + <element name="extension"> + <complexType> + <sequence minOccurs="1" maxOccurs="unbounded"> + <element ref="contributor"/> + </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="contributor"> + <complexType> + <attribute name="id" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="class" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute kind="java"/> + </appinfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appinfo> + <meta.section type="since"/> + </appinfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="examples"/> + </appinfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="apiinfo"/> + </appinfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="implementation"/> + </appinfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + +</schema> diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/AttributeTaskMapper.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/AttributeTaskMapper.java new file mode 100644 index 000000000..6a890d19e --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/AttributeTaskMapper.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +import java.util.Map; +import java.util.Map.Entry; + +import org.eclipse.core.runtime.Assert; +import org.eclipse.mylyn.tasks.core.DefaultTaskSchema; +import org.eclipse.mylyn.tasks.core.RepositoryTaskData; +import org.eclipse.mylyn.tasks.core.TaskRepository; +import org.eclipse.mylyn.tasks.core.TaskSelection; +import org.eclipse.mylyn.tasks.ui.TasksUi; + +/** + * @author Steffen Pingel + */ +public class AttributeTaskMapper { + + private final Map<String, String> attributes; + + public AttributeTaskMapper(Map<String, String> attributes) { + Assert.isNotNull(attributes); + this.attributes = attributes; + } + + public boolean isMappingComplete() { + return getTaskRepository() != null && attributes.get(IRepositoryConstants.PRODUCT) != null; + } + + public TaskRepository getTaskRepository() { + TaskRepository taskRepository = null; + String repositoryUrl = attributes.get(IRepositoryConstants.REPOSITORY_URL); + if (repositoryUrl != null) { + String repositoryKind = attributes.get(IRepositoryConstants.REPOSITORY_KIND); + if (repositoryKind != null) { + taskRepository = TasksUi.getRepositoryManager().getRepository(repositoryUrl); + } else { + taskRepository = TasksUi.getRepositoryManager().getRepository(repositoryUrl, repositoryKind); + } + } + return taskRepository; + } + + public TaskSelection createTaskSelection() { + TaskSelection selection = new TaskSelection("", ""); + applyTo(selection.getTaskData()); + return selection; + } + + public void applyTo(RepositoryTaskData taskData) { + DefaultTaskSchema schema = new DefaultTaskSchema(taskData); + for (Entry<String, String> entry : attributes.entrySet()) { + if (IRepositoryConstants.PRODUCT.equals(entry.getKey())) { + schema.setProduct(entry.getValue()); + } else if (IRepositoryConstants.COMPONENT.equals(entry.getKey())) { + schema.setComponent(entry.getValue()); + } + } + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultTaskContributor.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultTaskContributor.java new file mode 100644 index 000000000..1b5e51c80 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultTaskContributor.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Map; + +import org.eclipse.core.runtime.IBundleGroup; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.mylyn.internal.tasks.bugs.wizards.FeatureStatus; +import org.eclipse.mylyn.tasks.bugs.AbstractTaskContributor; +import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; +import org.osgi.framework.Bundle; + +/** + * @author Steffen Pingel + */ +public class DefaultTaskContributor extends AbstractTaskContributor { + + @Override + public Map<String, String> getAttributes(IStatus status) { + return null; + } + + @Override + public String getDescription(IStatus status) { + if (status instanceof FeatureStatus) { + StringBuilder sb = new StringBuilder(); + sb.append("\n\n\n"); + sb.append("-- Installed Plug-ins --\n"); + IBundleGroup bundleGroup = ((FeatureStatus)status).getBundleGroup(); + + sb.append(bundleGroup.getIdentifier()); + sb.append(" "); + sb.append(bundleGroup.getVersion()); + + Bundle[] bundles = bundleGroup.getBundles(); + if (bundles != null) { + for (Bundle bundle : bundles) { + sb.append(bundle.getBundleId()); + } + } + return sb.toString(); + + } else { + StringBuilder sb = new StringBuilder(); + sb.append("\n\n-- Error Details --\n"); + if (status.getException() != null) { + sb.append("\nStack Trace:\n"); + StringWriter writer = new StringWriter(); + status.getException().printStackTrace(new PrintWriter(writer)); + sb.append(writer.getBuffer()); + } + return sb.toString(); + } + } + + @Override + public String getEditorId(IStatus status) { + return TaskEditor.ID_EDITOR; + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/IRepositoryConstants.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/IRepositoryConstants.java new file mode 100644 index 000000000..54e33f06e --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/IRepositoryConstants.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +/** + * @author Steffen Pingel + */ +public class IRepositoryConstants { + + public static final String REPOSITORY_URL = "repositoryUrl"; + + public static final String REPOSITORY_KIND = "repositoryKind"; + + public static final String COMPONENT = "component"; + + public static final String PRODUCT = "product"; + + public static final String BRANDING = "branding"; + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/KeyValueParser.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/KeyValueParser.java new file mode 100644 index 000000000..2468fd2c1 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/KeyValueParser.java @@ -0,0 +1,103 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +import java.text.ParseException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Steffen Pingel + */ +public class KeyValueParser { + + private final String text; + + private enum Mode { + KEY, VALUE + }; + + private Map<String, String> pairs; + + private StringBuilder token; + + private boolean escaping; + + private Mode mode; + + private String key; + + public KeyValueParser(String text) { + this.text = text; + + } + + public Map<String, String> parse() throws ParseException { + init(); + + for (int i = 0; i < text.length(); i++) { + char c = text.charAt(i); + switch (c) { + case '\\': + if (escaping) { + append(c); + } else { + escaping = true; + } + break; + case '=': + if (escaping) { + append(c); + } else if (mode == Mode.VALUE) { + throw new ParseException("Unexpected character '='", i); + } else { + key = token.toString(); + token.setLength(0); + mode = Mode.VALUE; + } + break; + case ';': + if (escaping) { + append(c); + } else if (mode == Mode.KEY) { + throw new ParseException("Unexpected character ';'", i); + } else { + pairs.put(key, token.toString()); + token.setLength(0); + mode = Mode.KEY; + } + break; + default: + append(c); + } + } + + if (mode == Mode.KEY) { + throw new ParseException("Unexpected end of input", text.length()); + } + + pairs.put(key, token.toString()); + + return Collections.unmodifiableMap(pairs); + } + + private void append(char c) { + escaping = false; + token.append(c); + } + + private void init() { + pairs = new HashMap<String, String>(); + token = new StringBuilder(); + mode = Mode.KEY; + escaping = false; + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/PluginRepositoryMapping.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/PluginRepositoryMapping.java new file mode 100644 index 000000000..ea159a33c --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/PluginRepositoryMapping.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Steffen Pingel + */ +public class PluginRepositoryMapping { + + private List<String> prefixes = new ArrayList<String>(); + + private Map<String, String> attributes = new HashMap<String, String>(); + + public void addPrefix(String prefix) { + prefixes.add(prefix); + } + + public void addAttributes(Map<String, String> attributes) { + this.attributes.putAll(attributes); + } + + public void removePrefix(String prefix) { + prefixes.remove(prefix); + } + + public Map<String, String> getAttributes() { + return Collections.unmodifiableMap(attributes); + } + + public List<String> getPrefixes() { + return Collections.unmodifiableList(prefixes); + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/PluginRepositoryMappingManager.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/PluginRepositoryMappingManager.java new file mode 100644 index 000000000..07d7276d2 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/PluginRepositoryMappingManager.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +import java.text.ParseException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.mylyn.monitor.core.StatusHandler; + +/** + * @author Steffen Pingel + */ +public class PluginRepositoryMappingManager { + + private static final String EXTENSION_ID_PLUGIN_REPOSITORY_MAPPING = "org.eclipse.mylyn.tasks.bugs.pluginRepositoryMappings"; + + private static final String ELEMENT_MAPPING = "mapping"; + + private static final String ELEMENT_MAPPING_ATTRIBUTES = "attributes"; + + private static final String ATTRIBUTE_PLUGID_ID_PREFIX = "pluginIdPrefix"; + + private TreeMap<String, PluginRepositoryMapping> mappingByPrefix; + + public PluginRepositoryMappingManager() { + readExtensions(); + } + + private void readMapping(IConfigurationElement element) { + String pluginIdPrefix = element.getAttribute(ATTRIBUTE_PLUGID_ID_PREFIX); + + Map<String, String> attributes = null; + IConfigurationElement[] attributeElements = element.getChildren(ELEMENT_MAPPING_ATTRIBUTES); + for (IConfigurationElement attributeElement : attributeElements) { + String repositoryAttributes = attributeElement.getValue(); + try { + KeyValueParser parser = new KeyValueParser(repositoryAttributes); + attributes = parser.parse(); + } catch (ParseException e) { + StatusHandler.log(new Status(IStatus.WARNING, TasksBugsPlugin.ID_PLUGIN, + "Invalid attributes in extension.", e)); + return; + } + } + + if (attributes != null) { + PluginRepositoryMapping pluginRepositoryMapping = new PluginRepositoryMapping(); + pluginRepositoryMapping.addAttributes(attributes); + pluginRepositoryMapping.addPrefix(pluginIdPrefix); + addPluginRepositoryMapping(pluginRepositoryMapping); + } else { + StatusHandler.log(new Status(IStatus.ERROR, TasksBugsPlugin.ID_PLUGIN, + "Missing attributes in extension.")); + } + } + + private void addPluginRepositoryMapping(PluginRepositoryMapping pluginRepositoryMapping) { + List<String> prefixs = pluginRepositoryMapping.getPrefixes(); + for (String prefix : prefixs) { + mappingByPrefix.put(prefix, pluginRepositoryMapping); + } + } + + private synchronized void readExtensions() { + mappingByPrefix = new TreeMap<String, PluginRepositoryMapping>(); + + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_ID_PLUGIN_REPOSITORY_MAPPING); + IExtension[] extensions = extensionPoint.getExtensions(); + for (IExtension extension : extensions) { + IConfigurationElement[] elements = extension.getConfigurationElements(); + for (IConfigurationElement element : elements) { + if (element.getName().equals(ELEMENT_MAPPING)) { + readMapping(element); + } + } + } + } + + public PluginRepositoryMapping getMapping(String prefix) { + return mappingByPrefix.get(prefix); + } + + public String getAttribute(String prefix, String key) { + for (int i = prefix.length() - 1; i >= 0; i--) { + PluginRepositoryMapping mapping = getMapping(prefix.substring(0, i)); + if (mapping != null) { + String value = mapping.getAttributes().get(key); + if (value != null) { + return value; + } + } + } + return null; + } + + public Map<String, String> getAllAttributes(String prefix) { + Map<String, String> attributes = new HashMap<String, String>(); + for (int i = 0; i <= prefix.length(); i++) { + PluginRepositoryMapping mapping = getMapping(prefix.substring(0, i)); + if (mapping != null) { + attributes.putAll(mapping.getAttributes()); + } + } + return attributes; + } + + public boolean hasMappings() { + return !mappingByPrefix.isEmpty(); + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TaskContributorManager.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TaskContributorManager.java new file mode 100644 index 000000000..d1f408085 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TaskContributorManager.java @@ -0,0 +1,114 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.mylyn.internal.monitor.core.IMonitorCoreConstants; +import org.eclipse.mylyn.monitor.core.StatusHandler; +import org.eclipse.mylyn.tasks.bugs.AbstractTaskContributor; +import org.eclipse.mylyn.tasks.core.RepositoryTaskData; + +/** + * @author Steffen Pingel + */ +public class TaskContributorManager { + + private static final String ELEMENT_CLASS = "class"; + + private static final String ELEMENT_TASK_CONTRIBUTOR = "contributor"; + + private static final String EXTENSION_ID_TASK_CONTRIBUTORS = "org.eclipse.mylyn.tasks.bugs.taskContributors"; + + private final DefaultTaskContributor defaultTaskContributor = new DefaultTaskContributor(); + + private boolean readExtensions; + + private final List<AbstractTaskContributor> taskContributors = new CopyOnWriteArrayList<AbstractTaskContributor>(); + + public void addErrorReporter(AbstractTaskContributor taskContributor) { + taskContributors.add(taskContributor); + } + + public String getEditorId(IStatus status) { + readExtensions(); + + for (AbstractTaskContributor contributor : taskContributors) { + String editorId = contributor.getEditorId(status); + if (editorId != null) { + return editorId; + } + } + + return defaultTaskContributor.getEditorId(status); + } + + private synchronized void readExtensions() { + if (readExtensions) { + return; + } + readExtensions = true; + + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_ID_TASK_CONTRIBUTORS); + IExtension[] extensions = extensionPoint.getExtensions(); + for (IExtension extension : extensions) { + IConfigurationElement[] elements = extension.getConfigurationElements(); + for (IConfigurationElement element : elements) { + if (element.getName().equals(ELEMENT_TASK_CONTRIBUTOR)) { + readTaskContributor(element); + } + } + } + } + + private void readTaskContributor(IConfigurationElement element) { + try { + Object object = element.createExecutableExtension(ELEMENT_CLASS); + if (object instanceof AbstractTaskContributor) { + taskContributors.add((AbstractTaskContributor) object); + } else { + StatusHandler.log(new Status(IStatus.WARNING, IMonitorCoreConstants.ID_PLUGIN, + "Could not load task contributor extenstion: \"" + object.getClass().getCanonicalName() + "\"" + + " does not implement \"" + AbstractTaskContributor.class.getCanonicalName() + "\"")); + } + } catch (CoreException e) { + StatusHandler.log(new Status(IStatus.WARNING, IMonitorCoreConstants.ID_PLUGIN, + "Could not load task contributor extension", e)); + } + } + + public void removeErrorReporter(AbstractTaskContributor taskContributor) { + taskContributors.remove(taskContributor); + } + + public void updateAttributes(RepositoryTaskData taskData, IStatus status) { + readExtensions(); + + for (AbstractTaskContributor contributor : taskContributors) { + String description = contributor.getDescription(status); + if (description != null) { + taskData.setDescription(description); + return; + } + } + + taskData.setDescription(defaultTaskContributor.getDescription(status)); + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TaskErrorReporter.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TaskErrorReporter.java new file mode 100644 index 000000000..565ab35ac --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TaskErrorReporter.java @@ -0,0 +1,154 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +import java.lang.reflect.InvocationTargetException; +import java.util.Map; + +import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; +import org.eclipse.mylyn.monitor.core.AbstractErrorReporter; +import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory; +import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; +import org.eclipse.mylyn.tasks.core.AbstractTask; +import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler; +import org.eclipse.mylyn.tasks.core.RepositoryTaskData; +import org.eclipse.mylyn.tasks.core.TaskRepository; +import org.eclipse.mylyn.tasks.core.TaskSelection; +import org.eclipse.mylyn.tasks.ui.TasksUi; +import org.eclipse.mylyn.tasks.ui.TasksUiUtil; +import org.eclipse.mylyn.tasks.ui.editors.NewTaskEditorInput; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; + +/** + * @author Steffen Pingel + */ +public class TaskErrorReporter extends AbstractErrorReporter { + + private PluginRepositoryMappingManager manager; + + TaskErrorReporter() { + manager = new PluginRepositoryMappingManager(); + } + + public boolean isEnabled() { + return manager.hasMappings(); + } + + @Override + public int getPriority(IStatus status) { + Assert.isNotNull(status); + + String pluginId = status.getPlugin(); + for (int i = 0; i <= pluginId.length(); i++) { + if (manager.getMapping(pluginId.substring(0, i)) != null) { + return PRIORITY_DEFAULT; + } + } + + return PRIORITY_NONE; + } + + @Override + public void handle(IStatus status) { + Assert.isNotNull(status); + + String pluginId = status.getPlugin(); + Map<String, String> attributes = manager.getAllAttributes(pluginId); + + openNewTaskEditor(status, attributes); + } + + private void openNewTaskEditor(IStatus status, Map<String, String> attributes) { + AttributeTaskMapper mapper = new AttributeTaskMapper(attributes); + + TaskRepository taskRepository = mapper.getTaskRepository(); + try { + if (taskRepository != null) { + RepositoryTaskData taskData = createTaskData(taskRepository, mapper); + if (taskData != null) { + taskData.setSummary(status.getMessage()); + + TaskContributorManager manager = new TaskContributorManager(); + manager.updateAttributes(taskData, status); + + String editorId = manager.getEditorId(status); + + NewTaskEditorInput editorInput = new NewTaskEditorInput(taskRepository, taskData); + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + TasksUiUtil.openEditor(editorInput, editorId, page); + return; + } + } + + TaskSelection taskSelection = mapper.createTaskSelection(); + updateAttributes(taskSelection.getTaskData(), status); + + // fall back to opening wizard + TasksUiUtil.openNewTaskEditor(null, taskSelection, taskRepository); + } catch (OperationCanceledException e) { + // ignore + } + } + + private RepositoryTaskData createTaskData(final TaskRepository taskRepository, AttributeTaskMapper mapper) { + AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector( + taskRepository.getConnectorKind()); + final AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); + if (taskDataHandler == null) { + return null; + } + + AbstractAttributeFactory attributeFactory = taskDataHandler.getAttributeFactory(taskRepository.getRepositoryUrl(), + taskRepository.getConnectorKind(), AbstractTask.DEFAULT_TASK_KIND); + + final RepositoryTaskData taskData = new RepositoryTaskData(attributeFactory, taskRepository.getConnectorKind(), + taskRepository.getRepositoryUrl(), TasksUiPlugin.getDefault().getNextNewRepositoryTaskId()); + taskData.setNew(true); + + mapper.applyTo(taskData); + + try { + IRunnableWithProgress runnable = new IRunnableWithProgress() { + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + try { + if (!taskDataHandler.initializeTaskData(taskRepository, taskData, monitor)) { + throw new InvocationTargetException(new Exception()); + } + } catch (CoreException e) { + throw new InvocationTargetException(e); + } catch (OperationCanceledException e) { + throw new InterruptedException(); + } + } + }; + + PlatformUI.getWorkbench().getProgressService().busyCursorWhile(runnable); + } catch (InvocationTargetException e) { + return null; + } catch (InterruptedException e) { + throw new OperationCanceledException(); + } + + taskDataHandler.cloneTaskData(mapper.createTaskSelection().getTaskData(), taskData); + + return taskData; + } + + private void updateAttributes(RepositoryTaskData taskData, IStatus status) { + + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TasksBugsPlugin.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TasksBugsPlugin.java new file mode 100644 index 000000000..3d1dc6472 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/TasksBugsPlugin.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * @author Steffen Pingel + */ +public class TasksBugsPlugin extends AbstractUIPlugin { + + public static final String ID_PLUGIN = "org.eclipse.mylyn.tasks.bugs"; + + private static TasksBugsPlugin INSTANCE; + + private static TaskErrorReporter taskErrorReporter; + + public static TasksBugsPlugin getDefault() { + return INSTANCE; + } + + public static synchronized TaskErrorReporter getTaskErrorReporter() { + if (taskErrorReporter == null) { + taskErrorReporter = new TaskErrorReporter(); + } + return taskErrorReporter; + } + + public TasksBugsPlugin() { + } + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + INSTANCE = this; + } + + @Override + public void stop(BundleContext context) throws Exception { + INSTANCE = null; + super.stop(context); + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/actions/NewTaskFromErrorAction.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/actions/NewTaskFromErrorAction.java new file mode 100644 index 000000000..1308e852c --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/actions/NewTaskFromErrorAction.java @@ -0,0 +1,114 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + * + * Contributors: + * Chris Aniszczyk <zx@us.ibm.com> - bug 208819 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs.actions; + +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.mylyn.internal.tasks.bugs.TasksBugsPlugin; +import org.eclipse.mylyn.tasks.core.TaskSelection; +import org.eclipse.mylyn.tasks.ui.TasksUiUtil; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IObjectActionDelegate; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.internal.views.log.LogEntry; + +/** + * Creates a new task from the selected error log entry. + * + * @author Jeff Pound + * @author Steffen Pingel + */ +public class NewTaskFromErrorAction implements IObjectActionDelegate { + + public static final String ID = "org.eclipse.mylyn.tasklist.ui.repositories.actions.create"; + + private LogEntry entry; + + /** + * Fills a {@link StringBuilder} with {@link LogEntry} information, optionally including subentries too + * + * @param entry + * The {@link LogEntry} who provides the information + * @param sb + * An {@link StringBuilder} to be filled with + * @param includeChildren + * Indicates if it should include subentries, if the {@link LogEntry} have any + */ + private void buildDescriptionFromLogEntry(LogEntry entry, StringBuilder sb, boolean includeChildren) { + sb.append("\n\n-- Error Log --\nDate: "); + sb.append(entry.getDate()); + sb.append("\nMessage: "); + sb.append(entry.getMessage()); + sb.append("\nSeverity: " + entry.getSeverityText()); + sb.append("\nPlugin ID: "); + sb.append(entry.getPluginId()); + sb.append("\nStack Trace:\n"); + if (entry.getStack() == null) { + sb.append("no stack trace available"); + } else { + sb.append(entry.getStack()); + } + + if (includeChildren && entry.hasChildren()) { + Object[] children = entry.getChildren(null); + for (Object child : children) { + if (child instanceof LogEntry) { + buildDescriptionFromLogEntry((LogEntry) child, sb, includeChildren); + } + } + } + } + + private void createTask(LogEntry entry) { + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + boolean includeChildren = false; + + if (entry.hasChildren() + && MessageDialog.openQuestion(shell, "Report Bug", "Include children of this entry in the report?")) { + includeChildren = true; + } + + StringBuilder sb = new StringBuilder(); + buildDescriptionFromLogEntry(entry, sb, includeChildren); + + if (TasksBugsPlugin.getTaskErrorReporter().isEnabled()) { + Status status = new Status(entry.getSeverity(), entry.getPluginId(), entry.getMessage()); + TasksBugsPlugin.getTaskErrorReporter().handle(status); + } else { + TaskSelection taskSelection = new TaskSelection("", sb.toString()); + TasksUiUtil.openNewTaskEditor(shell, taskSelection, null); + } + } + + public void run() { + createTask(entry); + } + + public void run(IAction action) { + run(); + } + + public void selectionChanged(IAction action, ISelection selection) { + Object object = ((IStructuredSelection) selection).getFirstElement(); + if (object instanceof LogEntry) { + entry = (LogEntry) object; + } + } + + public void setActivePart(IAction action, IWorkbenchPart targetPart) { + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/actions/ReportBugAction.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/actions/ReportBugAction.java new file mode 100644 index 000000000..9d4df472d --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/actions/ReportBugAction.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.mylyn.internal.tasks.bugs.TasksBugsPlugin; +import org.eclipse.mylyn.internal.tasks.bugs.wizards.ReportBugWizard; +import org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskAction; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + +/** + * @author Mik Kersten + */ +public class ReportBugAction implements IWorkbenchWindowActionDelegate { + + private IWorkbenchWindow window; + + public void dispose() { + } + + public void init(IWorkbenchWindow window) { + this.window = window; + } + + public void run(IAction action) { + if (TasksBugsPlugin.getTaskErrorReporter().isEnabled()) { + WizardDialog dialog = new WizardDialog(window.getShell(), new ReportBugWizard()); + dialog.open(); + } else { + new NewTaskAction().run(action); + } + } + + public void selectionChanged(IAction action, ISelection selection) { + // ignore + } +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/FeatureStatus.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/FeatureStatus.java new file mode 100644 index 000000000..5637669ab --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/FeatureStatus.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs.wizards; + +import org.eclipse.core.runtime.IBundleGroup; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; + +/** + * @author Steffen Pingel + */ +public class FeatureStatus extends Status { + + private final IBundleGroup bundleGroup; + + public FeatureStatus(IBundleGroup bundleGroup) { + super(IStatus.INFO, bundleGroup.getIdentifier(), ""); + this.bundleGroup = bundleGroup; + } + + public IBundleGroup getBundleGroup() { + return bundleGroup; + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/ReportBugWizard.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/ReportBugWizard.java new file mode 100644 index 000000000..4f8c156f7 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/ReportBugWizard.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs.wizards; + +import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.IBundleGroup; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.mylyn.internal.tasks.bugs.TasksBugsPlugin; +import org.eclipse.mylyn.internal.tasks.bugs.PluginRepositoryMappingManager; +import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages; + +/** + * @author Steffen Pingel + */ +public class ReportBugWizard extends Wizard { + + private SelectProductPage selectProductPage; + + private PluginRepositoryMappingManager manager; + + public ReportBugWizard() { + setForcePreviousAndNextButtons(true); + setNeedsProgressMonitor(false); + setWindowTitle("Report Bug or Enhancement"); + setDefaultPageImageDescriptor(TasksUiImages.BANNER_REPOSITORY); + } + + @Override + public void addPages() { + manager = new PluginRepositoryMappingManager(); + selectProductPage = new SelectProductPage("selectBundleGroupProvider", manager); + addPage(selectProductPage); + } + + @Override + public boolean canFinish() { + return getSelectedBundleGroup() != null; + } + + public IBundleGroup getSelectedBundleGroup() { + IWizardPage page = getContainer().getCurrentPage(); + if (page instanceof SelectProductPage) { + if (page.isPageComplete() && !((SelectProductPage)page).canFlipToNextPage()) { + return ((SelectProductPage)page).getSelectedBundleGroup(); + } + } else if (page instanceof SelectFeaturePage) { + if (page.isPageComplete()) { + return ((SelectFeaturePage)page).getSelectedBundleGroup(); + } + } + return null; + } + + @Override + public boolean performFinish() { + final IBundleGroup bundle = getSelectedBundleGroup(); + Assert.isNotNull(bundle); + + // delay run this until after the dialog has been closed + getShell().getDisplay().asyncExec(new Runnable() { + public void run() { + TasksBugsPlugin.getTaskErrorReporter().handle(new FeatureStatus(bundle)); + } + }); + + return true; + } + +} diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectFeaturePage.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectFeaturePage.java new file mode 100644 index 000000000..16d81588a --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectFeaturePage.java @@ -0,0 +1,157 @@ +/******************************************************************************* + * 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs.wizards; + +import java.net.MalformedURLException; +import java.net.URL; + +import org.eclipse.core.runtime.IBundleGroup; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.viewers.IOpenListener; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.OpenEvent; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.mylyn.tasks.ui.TasksUi; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.branding.IBundleGroupConstants; + +/** + * @author Steffen Pingel + */ +public class SelectFeaturePage extends WizardPage { + + private static final int TABLE_HEIGHT = IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH; + + private IBundleGroup selectedBundleGroup; + + private final IBundleGroup[] bundleGroups; + + private ImageRegistry imageRegistry; + + public SelectFeaturePage(String pageName, IBundleGroup[] bundleGroups) { + super(pageName); + this.bundleGroups = bundleGroups; + setTitle("Select a feature"); + } + + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(1, true); + container.setLayout(layout); + + imageRegistry = new ImageRegistry(getShell().getDisplay()); + + for (IBundleGroup bundleGroup : bundleGroups) { + String imageUrl = bundleGroup.getProperty(IBundleGroupConstants.FEATURE_IMAGE); + if (imageUrl != null) { + try { + ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(new URL(imageUrl)); + imageRegistry.put(bundleGroup.getIdentifier(), imageDescriptor); + } catch (MalformedURLException e) { + // ignore + } + } + } + + TableViewer viewer = new TableViewer(container, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).hint(SWT.DEFAULT, TABLE_HEIGHT).applyTo(viewer.getControl()); + viewer.setContentProvider(new IStructuredContentProvider() { + + public Object[] getElements(Object inputElement) { + return bundleGroups; + } + + public void dispose() { + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + + }); + viewer.setLabelProvider(new LabelProvider() { + + @Override + public Image getImage(Object element) { + if (element instanceof IBundleGroup) { + IBundleGroup bundleGroup = (IBundleGroup) element; + return imageRegistry.get(bundleGroup.getIdentifier()); + } + return null; + } + + @Override + public String getText(Object element) { + if (element instanceof IBundleGroup) { + IBundleGroup bundleGroup = (IBundleGroup) element; + return bundleGroup.getName(); + } + return ""; + } + + }); + viewer.setInput(TasksUi.getRepositoryManager().getRepositoryConnectors()); + + viewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + IStructuredSelection selection = (IStructuredSelection) event.getSelection(); + if (selection.getFirstElement() instanceof IBundleGroup) { + selectedBundleGroup = (IBundleGroup) selection.getFirstElement(); + setMessage(selectedBundleGroup.getDescription()); + setPageComplete(true); + } else { + setMessage(null); + setPageComplete(false); + } + } + }); + + viewer.addOpenListener(new IOpenListener() { + + public void open(OpenEvent event) { + if (getWizard().performFinish()) { + ((WizardDialog) getContainer()).close(); + } + } + }); + + viewer.getTable().showSelection(); + viewer.getTable().setFocus(); + + viewer.setSorter(new ViewerSorter()); + + setControl(container); + } + + @Override + public void dispose() { + if (imageRegistry != null) { + imageRegistry.dispose(); + } + super.dispose(); + } + + public IBundleGroup getSelectedBundleGroup() { + return selectedBundleGroup; + } + +}
\ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectProductPage.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectProductPage.java new file mode 100644 index 000000000..4629721b9 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectProductPage.java @@ -0,0 +1,283 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.internal.tasks.bugs.wizards; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.IBundleGroup; +import org.eclipse.core.runtime.IBundleGroupProvider; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.viewers.IOpenListener; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.OpenEvent; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.mylyn.internal.tasks.bugs.AttributeTaskMapper; +import org.eclipse.mylyn.internal.tasks.bugs.IRepositoryConstants; +import org.eclipse.mylyn.internal.tasks.bugs.PluginRepositoryMappingManager; +import org.eclipse.mylyn.tasks.ui.TasksUi; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.branding.IBundleGroupConstants; + +/** + * @author Steffen Pingel + */ +public class SelectProductPage extends WizardPage { + + private static final int TABLE_HEIGHT = IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH; + + /** + * A container for bundles that map to the same name. + */ + private class BundleGroupContainer { + + private final IBundleGroup displayGroup; + + private final List<IBundleGroup> groups; + + private final String name; + + public BundleGroupContainer(String name, IBundleGroup displayGroup) { + this.name = name; + this.displayGroup = displayGroup; + this.groups = new ArrayList<IBundleGroup>(); + this.groups.add(displayGroup); + } + + public IBundleGroup getDisplayGroup() { + return displayGroup; + } + + public void addBundleGroup(IBundleGroup bundleGroup) { + for (IBundleGroup group : groups) { + if (group.getName().equals(bundleGroup.getName())) { + return; + } + } + groups.add(bundleGroup); + } + + public List<IBundleGroup> getGroups() { + return groups; + } + + private String getName() { + return name; + } + + public boolean requiresSelection() { + return groups.size() > 1; + } + + } + + private ImageRegistry imageRegistry; + + private final PluginRepositoryMappingManager manager; + + private BundleGroupContainer selectedBundleGroupContainer; + + public SelectProductPage(String pageName, PluginRepositoryMappingManager manager) { + super(pageName); + this.manager = manager; + setTitle("Select a product"); + } + + @Override + public boolean canFlipToNextPage() { + return selectedBundleGroupContainer != null && selectedBundleGroupContainer.requiresSelection(); + } + + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + composite.setLayout(layout); + + imageRegistry = new ImageRegistry(getShell().getDisplay()); + + final Map<String, BundleGroupContainer> containerByName = getProducts(); + + TableViewer viewer = new TableViewer(composite, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).hint(SWT.DEFAULT, TABLE_HEIGHT).applyTo(viewer.getControl()); + viewer.setContentProvider(new IStructuredContentProvider() { + + public void dispose() { + } + + public Object[] getElements(Object inputElement) { + return containerByName.values().toArray(); + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + + }); + viewer.setLabelProvider(new LabelProvider() { + + @Override + public Image getImage(Object element) { + if (element instanceof BundleGroupContainer) { + BundleGroupContainer product = (BundleGroupContainer) element; + return imageRegistry.get(product.getName()); + } + return null; + } + + @Override + public String getText(Object element) { + if (element instanceof BundleGroupContainer) { + BundleGroupContainer product = (BundleGroupContainer) element; + return product.getName(); + } + return ""; + } + + }); + viewer.setInput(TasksUi.getRepositoryManager().getRepositoryConnectors()); + + viewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + IStructuredSelection selection = (IStructuredSelection) event.getSelection(); + if (selection.getFirstElement() instanceof BundleGroupContainer) { + selectedBundleGroupContainer = (BundleGroupContainer) selection.getFirstElement(); + if (selectedBundleGroupContainer.requiresSelection()) { + setMessage(null); + } else { + setMessage(selectedBundleGroupContainer.getDisplayGroup().getDescription()); + } + setPageComplete(true); + } else { + setMessage(null); + setPageComplete(false); + } + } + }); + + viewer.addOpenListener(new IOpenListener() { + + public void open(OpenEvent event) { + if (canFlipToNextPage()) { + getContainer().showPage(getNextPage()); + } else if (isPageComplete()) { + if (getWizard().performFinish()) { + ((WizardDialog) getContainer()).close(); + } + } + } + }); + + viewer.getTable().showSelection(); + viewer.getTable().setFocus(); + + viewer.setSorter(new ViewerSorter()); + + setControl(composite); + } + + @Override + public void dispose() { + if (imageRegistry != null) { + imageRegistry.dispose(); + } + super.dispose(); + } + + @Override + public IWizardPage getNextPage() { + if (canFlipToNextPage()) { + SelectFeaturePage page = new SelectFeaturePage("selectBundle", getSelectedBundleGroups()); + page.setWizard(getWizard()); + return page; + } + return null; + } + + private Map<String, BundleGroupContainer> getProducts() { + final Map<String, BundleGroupContainer> containerByName = new HashMap<String, BundleGroupContainer>(); + IBundleGroupProvider[] providers = Platform.getBundleGroupProviders(); + if (providers != null) { + for (IBundleGroupProvider provider : providers) { + for (IBundleGroup bundleGroup : provider.getBundleGroups()) { + addProduct(containerByName, bundleGroup); + } + } + } + return containerByName; + } + + private void addProduct(Map<String, BundleGroupContainer> containerByName, IBundleGroup bundleGroup) { + Map<String, String> attributes = manager.getAllAttributes(bundleGroup.getIdentifier()); + + AttributeTaskMapper mapper = new AttributeTaskMapper(attributes); + if (!mapper.isMappingComplete()) { + return; + } + + String imageUrl = bundleGroup.getProperty(IBundleGroupConstants.FEATURE_IMAGE); + if (imageUrl == null) { + return; + } + + String productName = attributes.get(IRepositoryConstants.BRANDING); + if (productName == null) { + productName = bundleGroup.getName(); + } + + try { + ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(new URL(imageUrl)); + imageRegistry.put(productName, imageDescriptor); + } catch (MalformedURLException e) { + // ignore bundles that do not have a feature image + return; + } + + BundleGroupContainer container = containerByName.get(productName); + if (container == null) { + container = new BundleGroupContainer(productName, bundleGroup); + containerByName.put(productName, container); + } else { + container.addBundleGroup(bundleGroup); + } + } + + public IBundleGroup getSelectedBundleGroup() { + if (selectedBundleGroupContainer != null) { + return selectedBundleGroupContainer.getGroups().get(0); + } + return null; + } + + public IBundleGroup[] getSelectedBundleGroups() { + if (selectedBundleGroupContainer != null) { + return selectedBundleGroupContainer.getGroups().toArray(new IBundleGroup[0]); + } + return null; + } + +}
\ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/tasks/bugs/AbstractTaskContributor.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/tasks/bugs/AbstractTaskContributor.java new file mode 100644 index 000000000..62e9ffb35 --- /dev/null +++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/tasks/bugs/AbstractTaskContributor.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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 + *******************************************************************************/ + +package org.eclipse.mylyn.tasks.bugs; + +import java.util.Map; + +import org.eclipse.core.runtime.IStatus; + +/** + * Note: This API is likely to change for 3.0. + * + * @author Steffen Pingel + * @since 2.3 + */ +public abstract class AbstractTaskContributor { + + public abstract Map<String, String> getAttributes(IStatus status); + + public abstract String getDescription(IStatus status); + + public abstract String getEditorId(IStatus status); + +} |