diff options
author | Max Hohenegger | 2015-04-30 09:48:23 +0000 |
---|---|---|
committer | Matthias Sohn | 2015-05-15 21:04:42 +0000 |
commit | 9904bd578ea60f3d28f38fec69af0456af805b12 (patch) | |
tree | 1ff9f0de63f988efae28eb2815cfb8772fce54cb /org.eclipse.egit.gitflow.ui | |
parent | 12a6299909b1bda6a3a4957aa0d6e2c89869c18f (diff) | |
download | egit-9904bd578ea60f3d28f38fec69af0456af805b12.tar.gz egit-9904bd578ea60f3d28f38fec69af0456af805b12.tar.xz egit-9904bd578ea60f3d28f38fec69af0456af805b12.zip |
Extend EGit to allow use of git-flow
Initial implementation:
- Operations for all commonly used git flow commands without optional
parameters
- Menu contributions in the repository and history view, as well as the
team menu on projects
- Added new feature as incubation project to update site
- Non-UI tests (see launch config)
CQ: 9662
Bug: 348610
Change-Id: I215ed28e6434a789fa7260d7072532b402a1e714
Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.gitflow.ui')
39 files changed, 2863 insertions, 0 deletions
diff --git a/org.eclipse.egit.gitflow.ui/.classpath b/org.eclipse.egit.gitflow.ui/.classpath new file mode 100644 index 0000000000..f2156e9916 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/org.eclipse.egit.gitflow.ui/.project b/org.eclipse.egit.gitflow.ui/.project new file mode 100644 index 0000000000..be30986add --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/.project @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.egit.gitflow.ui</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> + </natures> +</projectDescription> + diff --git a/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.core.resources.prefs b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/<project>=UTF-8 diff --git a/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000000..dfc3779a15 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,3 @@ +#Mon Mar 24 18:54:53 EDT 2008 +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..448fcfd79e --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,393 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=warning +org.eclipse.jdt.core.compiler.problem.comparingIdentical=error +org.eclipse.jdt.core.compiler.problem.deadCode=error +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=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +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.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=error +org.eclipse.jdt.core.compiler.problem.unusedLabel=error +org.eclipse.jdt.core.compiler.problem.unusedLocal=error +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error +org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=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=true +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=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..c336cce6ed --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,61 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_JGit Format +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=false +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=true +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=false +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000..f897a7f1cb --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF b/org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..ba70137aa9 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF @@ -0,0 +1,32 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: GitFlow UI +Bundle-SymbolicName: org.eclipse.egit.gitflow.ui;singleton:=true +Bundle-Version: 4.0.0.qualifier +Bundle-Activator: org.eclipse.egit.gitflow.ui.Activator +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy +Bundle-Localization: plugin +Import-Package: org.eclipse.egit.core;version="[4.0.0,4.1.0)", + org.eclipse.egit.core.internal;version="[4.0.0,4.1.0)", + org.eclipse.egit.core.internal.job;version="[4.0.0,4.1.0)", + org.eclipse.egit.core.op;version="[4.0.0,4.1.0)", + org.eclipse.egit.core.project;version="[4.0.0,4.1.0)", + org.eclipse.egit.gitflow, + org.eclipse.egit.gitflow.op, + org.eclipse.egit.ui;version="[4.0.0,4.1.0)", + org.eclipse.egit.ui.internal;version="[4.0.0,4.1.0)", + org.eclipse.egit.ui.internal.branch;version="[4.0.0,4.1.0)", + org.eclipse.egit.ui.internal.repository.tree;version="[4.0.0,4.1.0)", + org.eclipse.egit.ui.internal.selection;version="[4.0.0,4.1.0)", + org.eclipse.jgit.api;version="[4.0.0,4.1.0)", + org.eclipse.jgit.api.errors;version="[4.0.0,4.1.0)", + org.eclipse.jgit.lib;version="[4.0.0,4.1.0)", + org.eclipse.jgit.revplot;version="[4.0.0,4.1.0)", + org.eclipse.jgit.revwalk;version="[4.0.0,4.1.0)" +Require-Bundle: org.eclipse.core.jobs;bundle-version="[3.4.0,4.0.0)", + org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)", + org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)", + org.eclipse.team.ui;bundle-version="[3.4.0,4.0.0)", + org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)", + org.eclipse.ui;bundle-version="[3.4.0,4.0.0)" diff --git a/org.eclipse.egit.gitflow.ui/about.html b/org.eclipse.egit.gitflow.ui/about.html new file mode 100644 index 0000000000..a14d39be00 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>May 9, 2015</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">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/org.eclipse.egit.gitflow.ui/build.properties b/org.eclipse.egit.gitflow.ui/build.properties new file mode 100644 index 0000000000..ff1f844c8a --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties,\ + about.html diff --git a/org.eclipse.egit.gitflow.ui/plugin.properties b/org.eclipse.egit.gitflow.ui/plugin.properties new file mode 100644 index 0000000000..f10eb5d177 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/plugin.properties @@ -0,0 +1,14 @@ +TeamGitFlowInit.name = Init Git Flow +TeamGitFlowMenu.name = Git Flow +TeamGitFlowFeatureStart.name = Start Feature +TeamGitFlowFeatureFinish.name = Finish Feature +TeamGitFlowReleaseStart.name = Start Release +TeamGitFlowReleaseFinish.name = Finish Release +TeamGitFlowFeaturePublish.name = Publish Feature +TeamGitFlowReleasePublish.name = Publish Release +TeamGitFlowHotfixPublish.name = Publish Hotfix +TeamGitFlowFeatureTrack.name = Track Feature +TeamGitFlowFeatureCheckout.name = Checkout Feature +TeamGitFlowFeatureRebase.name = Rebase Feature +TeamGitFlowHotfixStart.name = Start Hotfix +TeamGitFlowHotfixFinish.name = Finish Hotfix diff --git a/org.eclipse.egit.gitflow.ui/plugin.xml b/org.eclipse.egit.gitflow.ui/plugin.xml new file mode 100644 index 0000000000..e78a9159c3 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/plugin.xml @@ -0,0 +1,743 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.ui.menus"> + <menuContribution + locationURI="popup:org.eclipse.egit.ui.RepositoriesView?before=group.open"> + <separator + name="group.gitflow" + visible="true"> + </separator> + </menuContribution> + </extension> + <extension + point="org.eclipse.ui.menus"> + <menuContribution + locationURI="popup:org.eclipse.egit.ui.RepositoriesView?after=group.gitflow"> + <command + commandId="org.eclipse.egit.gitflow.ui.command.init" + label="%TeamGitFlowInit.name" + style="push"> + <visibleWhen + checkEnabled="false"> + <iterate + ifEmpty="false" + operator="and"> + <and> + <not> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isInitialized"> + </test> + </adapt> + </not> + </and> + </iterate> + </visibleWhen> + </command> + </menuContribution> + <menuContribution + locationURI="popup:org.eclipse.egit.ui.RepositoriesView?after=group.gitflow"> + <menu + label="%TeamGitFlowMenu.name"> + <visibleWhen + checkEnabled="false"> + <iterate + ifEmpty="false" + operator="and"> + <and> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isInitialized"> + </test> + </adapt> + </and> + </iterate> + </visibleWhen> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureStart" + label="%TeamGitFlowFeatureStart.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureFinish" + label="%TeamGitFlowFeatureFinish.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureRebase" + label="%TeamGitFlowFeatureRebase.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureCheckout" + label="%TeamGitFlowFeatureCheckout.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureTrack" + label="%TeamGitFlowFeatureTrack.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featurePublish" + label="%TeamGitFlowFeaturePublish.name" + style="push"> + </command> + <separator + name="org.eclipse.egit.gitflow.ui.separator1" + visible="true"> + </separator> + <command + commandId="org.eclipse.egit.gitflow.ui.command.releaseStart" + label="%TeamGitFlowReleaseStart.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.releaseFinish" + label="%TeamGitFlowReleaseFinish.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.releasePublish" + label="%TeamGitFlowReleasePublish.name" + style="push"> + </command> + <separator + name="org.eclipse.egit.gitflow.ui.separator2" + visible="true"> + </separator> + <command + commandId="org.eclipse.egit.gitflow.ui.command.hotfixStart" + label="%TeamGitFlowHotfixStart.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.hotfixFinish" + label="%TeamGitFlowHotfixFinish.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.hotfixPublish" + label="%TeamGitFlowHotfixPublish.name" + style="push"> + </command> + </menu> + </menuContribution> + <menuContribution + allPopups="false" + locationURI="popup:org.eclipse.egit.ui.historyPageContributions?after=additions"> + <menu + label="%TeamGitFlowMenu.name"> + <command + commandId="org.eclipse.egit.gitflow.ui.command.releaseStart" + label="%TeamGitFlowReleaseStart.name" + style="push"> + </command> + </menu> + </menuContribution> + </extension> + <extension + point="org.eclipse.ui.commands"> + <command + categoryId="org.eclipse.egit.ui.commandCategory" + id="org.eclipse.egit.gitflow.ui.command.init" + name="%TeamGitFlowInit.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.featureStart" + name="%TeamGitFlowFeatureStart.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.featureFinish" + name="%TeamGitFlowFeatureFinish.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.releaseStart" + name="%TeamGitFlowReleaseStart.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.releaseFinish" + name="%TeamGitFlowReleaseFinish.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.featurePublish" + name="%TeamGitFlowFeaturePublish.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.releasePublish" + name="%TeamGitFlowReleasePublish.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.hotfixPublish" + name="%TeamGitFlowHotfixPublish.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.featureTrack" + name="%TeamGitFlowFeatureTrack.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.featureCheckout" + name="%TeamGitFlowFeatureCheckout.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.featureRebase" + name="%TeamGitFlowFeatureRebase.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.hotfixStart" + name="%TeamGitFlowHotfixStart.name"> + </command> + <command + id="org.eclipse.egit.gitflow.ui.command.hotfixFinish" + name="%TeamGitFlowHotfixFinish.name"> + </command> + </extension> + <extension + point="org.eclipse.ui.handlers"> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.init"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.InitHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <and> + <not> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isInitialized"> + </test> + </adapt> + </not> + </and> + </iterate> + </enabledWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.featureStart"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.FeatureStartHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <and> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isDevelop"> + </test> + </adapt> + </and> + </iterate> + </enabledWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.featureFinish"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.FeatureFinishHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + + <and> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isFeature"> + </test> + </adapt> + </and> + </iterate> + </enabledWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.releaseStart"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.ReleaseStartHandler"> + </class> + <activeWhen> + <iterate> + <or> + <instanceof + value="org.eclipse.jgit.revwalk.RevCommit"> + </instanceof> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <and> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isDevelop"> + </test> + </adapt> + </and> + </iterate> + </enabledWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.releaseFinish"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.ReleaseFinishHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <and> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isRelease"> + </test> + </adapt> + </and> + </iterate> + </enabledWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.featurePublish"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.FeaturePublishHandler"> + </class> + + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <adapt type="org.eclipse.jgit.lib.Repository"> + <and> + <test + forcePluginActivation="true" + property="GitFlowRepository.isFeature"> + </test> + <test + forcePluginActivation="true" + property="GitFlowRepository.hasDefaultRemote"> + </test> + </and> + </adapt> + </iterate> + </enabledWhen> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.releasePublish"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.ReleasePublishHandler"> + </class> + + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <adapt type="org.eclipse.jgit.lib.Repository"> + <and> + <test + forcePluginActivation="true" + property="GitFlowRepository.isRelease"> + </test> + <test + forcePluginActivation="true" + property="GitFlowRepository.hasDefaultRemote"> + </test> + </and> + </adapt> + </iterate> + </enabledWhen> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.hotfixPublish"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.HotfixPublishHandler"> + </class> + + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <adapt type="org.eclipse.jgit.lib.Repository"> + <and> + <test + forcePluginActivation="true" + property="GitFlowRepository.isHotfix"> + </test> + <test + forcePluginActivation="true" + property="GitFlowRepository.hasDefaultRemote"> + </test> + </and> + </adapt> + </iterate> + </enabledWhen> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.featureTrack"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.FeatureTrackHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <adapt type="org.eclipse.jgit.lib.Repository"> + <and> + <test + forcePluginActivation="true" + property="GitFlowRepository.hasDefaultRemote"> + </test> + </and> + </adapt> + </iterate> + </enabledWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.featureCheckout"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.FeatureCheckoutHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.featureRebase"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.FeatureRebaseHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <adapt type="org.eclipse.jgit.lib.Repository"> + <and> + <test + forcePluginActivation="true" + property="GitFlowRepository.isFeature"> + </test> + </and> + </adapt> + </iterate> + </enabledWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.hotfixStart"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.HotfixStartHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <adapt type="org.eclipse.jgit.lib.Repository"> + <and> + <test + forcePluginActivation="true" + property="GitFlowRepository.isDevelop"> + </test> + </and> + </adapt> + </iterate> + </enabledWhen> + </handler> + <handler + commandId="org.eclipse.egit.gitflow.ui.command.hotfixFinish"> + <class + class="org.eclipse.egit.gitflow.ui.internal.actions.HotfixFinishHandler"> + </class> + <activeWhen> + <iterate> + <or> + <reference + definitionId="org.eclipse.egit.gitflow.ui.commandEnabled"> + </reference> + </or> + </iterate> + </activeWhen> + <enabledWhen> + <iterate + ifEmpty="false" + operator="and"> + <adapt type="org.eclipse.jgit.lib.Repository"> + <and> + <test + forcePluginActivation="true" + property="GitFlowRepository.isHotfix"> + </test> + </and> + </adapt> + </iterate> + </enabledWhen> + </handler> + </extension> + <extension + point="org.eclipse.core.expressions.propertyTesters"> + <propertyTester + class="org.eclipse.egit.gitflow.ui.internal.selection.SelectionPropertyTester" + id="org.eclipse.egit.gitflow.ui.propertyTester" + namespace="GitFlowRepository" + properties="isFeature,isRelease,isHotfix,isDevelop,isMaster,isInitialized,hasDefaultRemote" + type="org.eclipse.jgit.lib.Repository"> + </propertyTester> + </extension> + + <extension + point="org.eclipse.core.expressions.definitions"> + <definition + id="org.eclipse.egit.gitflow.ui.commandEnabled"> + <or> + <instanceof + value="org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode"> + </instanceof> + <instanceof + value="org.eclipse.core.resources.IResource"> + </instanceof> + </or> + </definition> + </extension> + <extension + point="org.eclipse.core.runtime.adapters"> + <factory adaptableType="org.eclipse.core.resources.IResource" + class="org.eclipse.egit.gitflow.ui.internal.factories.GitFlowAdapterFactory"> + <adapter type="org.eclipse.jgit.lib.Repository"/> + </factory> + </extension> + + + <extension + point="org.eclipse.ui.menus"> + <menuContribution + locationURI="popup:team.main?after=group11"> + <menu + label="%TeamGitFlowMenu.name"> + <visibleWhen + checkEnabled="false"> + <iterate + ifEmpty="false" + operator="and"> + <and> + <instanceof + value="org.eclipse.core.resources.IProject"> + </instanceof> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isInitialized"> + </test> + </adapt> + </and> + </iterate> + </visibleWhen> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureStart" + label="%TeamGitFlowFeatureStart.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureFinish" + label="%TeamGitFlowFeatureFinish.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureRebase" + label="%TeamGitFlowFeatureRebase.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureCheckout" + label="%TeamGitFlowFeatureCheckout.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featureTrack" + label="%TeamGitFlowFeatureTrack.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.featurePublish" + label="%TeamGitFlowFeaturePublish.name" + style="push"> + </command> + <separator + name="org.eclipse.egit.gitflow.ui.team.separator1" + visible="true"> + </separator> + <command + commandId="org.eclipse.egit.gitflow.ui.command.releaseStart" + label="%TeamGitFlowReleaseStart.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.releaseFinish" + label="%TeamGitFlowReleaseFinish.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.releasePublish" + label="%TeamGitFlowReleasePublish.name" + style="push"> + </command> + <separator + name="org.eclipse.egit.gitflow.ui.team.separator2" + visible="true"> + </separator> + <command + commandId="org.eclipse.egit.gitflow.ui.command.hotfixStart" + label="%TeamGitFlowHotfixStart.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.hotfixFinish" + label="%TeamGitFlowHotfixFinish.name" + style="push"> + </command> + <command + commandId="org.eclipse.egit.gitflow.ui.command.hotfixPublish" + label="%TeamGitFlowHotfixPublish.name" + style="push"> + </command> + </menu> + </menuContribution> + <menuContribution + locationURI="popup:team.main?after=group11"> + <command + commandId="org.eclipse.egit.gitflow.ui.command.init" + label="%TeamGitFlowInit.name" + style="push"> + <visibleWhen + checkEnabled="false"> + <iterate + ifEmpty="false" + operator="and"> + <and> + <instanceof + value="org.eclipse.core.resources.IProject"> + </instanceof> + <not> + <adapt type="org.eclipse.jgit.lib.Repository"> + <test + forcePluginActivation="true" + property="GitFlowRepository.isInitialized"> + </test> + </adapt> + </not> + </and> + </iterate> + </visibleWhen> + </command> + </menuContribution> + </extension> +</plugin> diff --git a/org.eclipse.egit.gitflow.ui/pom.xml b/org.eclipse.egit.gitflow.ui/pom.xml new file mode 100644 index 0000000000..4dc6b7edd8 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/pom.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2014, Max Hohenegger <eclipse@hohenegger.eu> + + 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 +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.eclipse.egit</groupId> + <artifactId>egit-parent</artifactId> + <version>4.0.0-SNAPSHOT</version> + </parent> + + <artifactId>org.eclipse.egit.gitflow.ui</artifactId> + <packaging>eclipse-plugin</packaging> + + <name>Git Flow UI</name> + + <build> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-source-plugin</artifactId> + </plugin> + </plugins> + </build> + +</project> diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java new file mode 100644 index 0000000000..e4c2c52041 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java @@ -0,0 +1,103 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + // The shared instance + private static Activator plugin; + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * @param message + * @param throwable + * @return Status constructed from parameters. + */ + public static IStatus error(String message, Throwable throwable) { + return new Status(IStatus.ERROR, getPluginId(), 0, message, throwable); + } + + /** + * @param message + * @return Status constructed from parameters. + */ + public static IStatus error(String message) { + return new Status(IStatus.ERROR, getPluginId(), message); + } + + /** + * @return the id of the egit ui plugin + */ + public static String getPluginId() { + return getDefault().getBundle().getSymbolicName(); + } + + /** + * Handle an error. The error is logged. If <code>show</code> is + * <code>true</code> the error is shown to the user. + * + * @param message a localized message + * @param throwable + * @param show + */ + public static void handleError(String message, Throwable throwable, + boolean show) { + handleIssue(IStatus.ERROR, message, throwable, show); + } + + /** + * Handle an issue. The issue is logged. If <code>show</code> is + * <code>true</code> the issue is shown to the user. + * + * @param severity + * status severity, use constants defined in {@link IStatus} + * @param message + * a localized message + * @param throwable + * @param show + */ + public static void handleIssue(int severity, String message, Throwable throwable, + boolean show) { + IStatus status = new Status(severity, getPluginId(), message, + throwable); + int style = StatusManager.LOG; + if (show) { + style |= StatusManager.SHOW; + } + StatusManager.getManager().handle(status, style); + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/JobFamilies.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/JobFamilies.java new file mode 100644 index 0000000000..ccd8b82d7b --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/JobFamilies.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal; + +/** + * Job families of GitFlow jobs. May be used in tests to join job execution. + * + */ +public class JobFamilies { + /** + * Git Flow Jobs + */ + public final static Object GITFLOW_FAMILY = new Object(); +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/UIText.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/UIText.java new file mode 100644 index 0000000000..a43b81d763 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/UIText.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal; + +import org.eclipse.osgi.util.NLS; + +/** + * Text resources for the plugin. Strings here can be i18n-ed simpler and avoid + * duplicating strings. + */ +public class UIText extends NLS { + + /** + * Do not in-line this into the static initializer as the + * "Find Broken Externalized Strings" tool will not be able to find the + * corresponding bundle file. + */ + private static final String BUNDLE_NAME = "org.eclipse.egit.gitflow.ui.internal.uitext"; //$NON-NLS-1$ + + static { + initializeMessages(BUNDLE_NAME, UIText.class); + } + + /** */ + public static String FeatureFinishHandler_finishingFeature; + + /** */ + public static String FeatureRebaseHandler_conflicts; + + /** */ + public static String FeatureRebaseHandler_rebaseFailed; + + /** */ + public static String FeatureRebaseHandler_rebasingFeature; + + /** */ + public static String FeatureRebaseHandler_resolveConflictsManually; + + /** */ + public static String FeatureStartHandler_pleaseProvideANameForTheNewFeature; + + /** */ + public static String FeatureStartHandler_provideFeatureName; + + /** */ + public static String FeatureStartHandler_startingNewFeature; + + /** */ + public static String FeatureTrackHandler_fetchingRemoteFeatures; + + /** */ + public static String FeatureTrackHandler_noRemoteFeatures; + + /** */ + public static String FeatureTrackHandler_noRemoteFeaturesFoundOnTheConfiguredRemote; + + /** */ + public static String FeatureTrackHandler_remoteFeatures; + + /** */ + public static String FeatureTrackHandler_selectFeature; + + /** */ + public static String FeatureTrackHandler_trackingFeature; + + /** */ + public static String HotfixFinishHandler_finishingHotfix; + + /** */ + public static String HotfixStartHandler_pleaseProvideANameForTheNewHotfix; + + /** */ + public static String HotfixStartHandler_provideHotfixName; + + /** */ + public static String HotfixStartHandler_startingNewHotfix; + + /** */ + public static String InitHandler_initializing; + + /** */ + public static String ReleaseFinishHandler_finishingRelease; + + /** */ + public static String ReleaseStartHandler_provideANameForTheNewRelease; + + /** */ + public static String ReleaseStartHandler_provideReleaseName; + + /** */ + public static String ReleaseStartHandler_startingNewRelease; + + /** */ + public static String FeatureCheckoutHandler_checkingOutFeature; + + /** */ + public static String FeatureCheckoutHandler_localFeatures; + + /** */ + public static String FeatureCheckoutHandler_selectFeature; + + /** */ + public static String FeaturePublishHandler_publishingFeature; + + /** */ + public static String ReleasePublishHandler_publishingRelease; + + /** */ + public static String HotfixPublishHandler_publishingHotfix; + + /** */ + public static String NameValidator_invalidName; + + /** */ + public static String NameValidator_nameAlreadyExists; + + /** */ + public static String FeatureCheckoutHandler_cleanupDialog_title; + + /** */ + public static String FeatureCheckoutHandler_cleanupDialog_text; +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java new file mode 100644 index 0000000000..8d3f25d4c4 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import static org.eclipse.egit.gitflow.ui.Activator.error; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.op.CurrentBranchPublishOperation; +import org.eclipse.egit.gitflow.ui.Activator; +import org.eclipse.egit.ui.JobFamilies; +import org.eclipse.egit.ui.UIPreferences; + +/** + * git flow {feature,release,hotfix} finish + */ +public abstract class AbstractPublishHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + + try { + int timeout = Activator.getDefault().getPreferenceStore() + .getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT); + CurrentBranchPublishOperation featurePublishOperation = new CurrentBranchPublishOperation( + gfRepo, timeout); + JobUtil.scheduleUserWorkspaceJob(featurePublishOperation, + getProgressText(), JobFamilies.REBASE); + } catch (CoreException e) { + return error(e.getMessage(), e); + } + + return null; + } + + /** + * @return Text to be shown when the operation is in progress + */ + abstract protected String getProgressText(); +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java new file mode 100644 index 0000000000..d237fc1501 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java @@ -0,0 +1,114 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import static org.eclipse.jgit.lib.Constants.R_HEADS; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.Status; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.op.FeatureCheckoutOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; +import org.eclipse.egit.gitflow.ui.internal.dialog.AbstractGitFlowBranchSelectionDialog; +import org.eclipse.egit.ui.internal.branch.CleanupUncomittedChangesDialog; +import org.eclipse.jface.window.Window; +import org.eclipse.jgit.api.CheckoutResult; +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.GitAPIException; +import org.eclipse.jgit.lib.Ref; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * git flow feature checkout + */ +public class FeatureCheckoutHandler extends AbstractHandler { + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + Repository repository = gfRepo.getRepository(); + + final List<Ref> refs = gfRepo.getFeatureBranches(); + + AbstractGitFlowBranchSelectionDialog<Ref> dialog = new AbstractGitFlowBranchSelectionDialog<Ref>( + HandlerUtil.getActiveShell(event), refs, + UIText.FeatureCheckoutHandler_selectFeature, + UIText.FeatureCheckoutHandler_localFeatures) { + @Override + protected String getPrefix() { + return R_HEADS + gfRepo.getConfig().getFeaturePrefix(); + } + }; + if (dialog.open() != Window.OK) { + return null; + } + final Ref ref = dialog.getSelectedNode(); + + try { + String featureName = gfRepo.getFeatureBranchName(ref); + // TODO: consider using BranchOperationUI because checkout can take + // a long time on large repositories + FeatureCheckoutOperation checkoutOperation = new FeatureCheckoutOperation( + gfRepo, featureName); + JobUtil.scheduleUserWorkspaceJob(checkoutOperation, + UIText.FeatureCheckoutHandler_checkingOutFeature, + JobFamilies.GITFLOW_FAMILY); + CheckoutResult result = checkoutOperation.getResult(); + if (!CheckoutResult.Status.OK.equals(result.getStatus())) { + Shell shell = HandlerUtil.getActiveShell(event); + if (!handleUncommittedFiles(gfRepo.getRepository(), shell, + repository.getWorkTree().getName())) { + return Status.CANCEL_STATUS; + } else { + JobUtil.scheduleUserWorkspaceJob(checkoutOperation, + UIText.FeatureCheckoutHandler_checkingOutFeature, + JobFamilies.GITFLOW_FAMILY); + } + } + } catch (GitAPIException e) { + throw new RuntimeException(e); + } + + return null; + } + + private boolean handleUncommittedFiles(Repository repo, Shell shell, + String repoName) throws GitAPIException { + try (Git git = new Git(repo)) { + org.eclipse.jgit.api.Status status = git.status().call(); + + if (status.hasUncommittedChanges()) { + List<String> files = new ArrayList<String>( + status.getUncommittedChanges()); + Collections.sort(files); + CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( + shell, + MessageFormat + .format(UIText.FeatureCheckoutHandler_cleanupDialog_title, + repoName), + UIText.FeatureCheckoutHandler_cleanupDialog_text, + repo, files); + cleanupUncomittedChangesDialog.open(); + return cleanupUncomittedChangesDialog.shouldContinue(); + } else { + return true; + } + } + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java new file mode 100644 index 0000000000..69fcc8b2a6 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import static org.eclipse.egit.gitflow.ui.Activator.error; + +import java.io.IOException; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.WrongGitFlowStateException; +import org.eclipse.egit.gitflow.op.FeatureFinishOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; + +/** + * git flow feature finish + */ +public class FeatureFinishHandler extends AbstractHandler { + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + + try { + FeatureFinishOperation operation = new FeatureFinishOperation(gfRepo); + JobUtil.scheduleUserWorkspaceJob(operation, + UIText.FeatureFinishHandler_finishingFeature, + JobFamilies.GITFLOW_FAMILY); + } catch (WrongGitFlowStateException | CoreException | IOException e) { + return error(e.getMessage(), e); + } + + return null; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeaturePublishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeaturePublishHandler.java new file mode 100644 index 0000000000..0bcc052549 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeaturePublishHandler.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import org.eclipse.egit.gitflow.ui.internal.UIText; + +/** + * git flow feature finish + */ +public class FeaturePublishHandler extends AbstractPublishHandler { + @Override + protected String getProgressText() { + return UIText.FeaturePublishHandler_publishingFeature; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureRebaseHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureRebaseHandler.java new file mode 100644 index 0000000000..d21127a3cb --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureRebaseHandler.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import static org.eclipse.egit.gitflow.ui.Activator.error; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.op.FeatureRebaseOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jgit.api.RebaseResult; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * git flow feature rebase + */ +public class FeatureRebaseHandler extends AbstractHandler { + private static final String INTERACTIVE_REBASE_VIEW_ID = "org.eclipse.egit.ui.InteractiveRebaseView"; //$NON-NLS-1$ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + + FeatureRebaseOperation featureRebaseOperation = new FeatureRebaseOperation(gfRepo); + JobUtil.scheduleUserWorkspaceJob(featureRebaseOperation, + UIText.FeatureRebaseHandler_rebasingFeature, + JobFamilies.GITFLOW_FAMILY); + + RebaseResult.Status status = featureRebaseOperation + .getOperationResult().getStatus(); + if (RebaseResult.Status.FAILED.equals(status)) { + return error(UIText.FeatureRebaseHandler_rebaseFailed); + } + if (!RebaseResult.Status.CONFLICTS.equals(status)) { + return null; + } + MessageDialog.openInformation(HandlerUtil.getActiveShell(event), + UIText.FeatureRebaseHandler_conflicts, + UIText.FeatureRebaseHandler_resolveConflictsManually); + try { + PlatformUI.getWorkbench().getActiveWorkbenchWindow() + .getActivePage().showView(INTERACTIVE_REBASE_VIEW_ID); + } catch (PartInitException e) { + return error(e.getMessage(), e); + } + + return null; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java new file mode 100644 index 0000000000..d55055a467 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.op.FeatureStartOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; +import org.eclipse.egit.gitflow.ui.internal.validation.FeatureNameValidator; +import org.eclipse.jface.dialogs.InputDialog; +import org.eclipse.jface.window.Window; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * git flow feature start + */ +public class FeatureStartHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + + InputDialog inputDialog = new InputDialog( + HandlerUtil.getActiveShell(event), + UIText.FeatureStartHandler_provideFeatureName, + UIText.FeatureStartHandler_pleaseProvideANameForTheNewFeature, + "", //$NON-NLS-1$ + new FeatureNameValidator(gfRepo)); + + if (inputDialog.open() != Window.OK) { + return null; + } + + final String featureName = inputDialog.getValue(); + FeatureStartOperation featureStartOperation = new FeatureStartOperation( + gfRepo, featureName); + JobUtil.scheduleUserWorkspaceJob(featureStartOperation, + UIText.FeatureStartHandler_startingNewFeature, + JobFamilies.GITFLOW_FAMILY); + + return null; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java new file mode 100644 index 0000000000..80f7148095 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import static org.eclipse.egit.gitflow.op.GitFlowOperation.SEP; +import static org.eclipse.jgit.lib.Constants.DEFAULT_REMOTE_NAME; +import static org.eclipse.jgit.lib.Constants.R_REMOTES; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.Status; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.op.FeatureListOperation; +import org.eclipse.egit.gitflow.op.FeatureTrackOperation; +import org.eclipse.egit.gitflow.ui.Activator; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; +import org.eclipse.egit.gitflow.ui.internal.dialog.AbstractGitFlowBranchSelectionDialog; +import org.eclipse.egit.ui.UIPreferences; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.window.Window; +import org.eclipse.jgit.lib.Ref; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * git flow feature track + */ +public class FeatureTrackHandler extends AbstractHandler { + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + final List<Ref> refs = new ArrayList<Ref>(); + Shell activeShell = HandlerUtil.getActiveShell(event); + + int timeout = Activator.getDefault().getPreferenceStore() + .getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT); + FeatureListOperation featureListOperation = new FeatureListOperation( + gfRepo, timeout); + JobUtil.scheduleUserWorkspaceJob(featureListOperation, + UIText.FeatureTrackHandler_fetchingRemoteFeatures, JobFamilies.GITFLOW_FAMILY); + List<Ref> remoteFeatures = featureListOperation.getResult(); + if (remoteFeatures.isEmpty()) { + MessageDialog.openInformation(activeShell, UIText.FeatureTrackHandler_noRemoteFeatures, + UIText.FeatureTrackHandler_noRemoteFeaturesFoundOnTheConfiguredRemote); + } + refs.addAll(remoteFeatures); + + AbstractGitFlowBranchSelectionDialog<Ref> dialog = new AbstractGitFlowBranchSelectionDialog<Ref>( + activeShell, refs, + UIText.FeatureTrackHandler_selectFeature, + UIText.FeatureTrackHandler_remoteFeatures) { + @Override + protected String getPrefix() { + return R_REMOTES + DEFAULT_REMOTE_NAME + SEP + + gfRepo.getConfig().getFeaturePrefix(); + } + }; + if (dialog.open() != Window.OK) { + return Status.CANCEL_STATUS; + } + + Ref ref = dialog.getSelectedNode(); + FeatureTrackOperation featureTrackOperation = new FeatureTrackOperation( + gfRepo, ref); + JobUtil.scheduleUserWorkspaceJob(featureTrackOperation, + UIText.FeatureTrackHandler_trackingFeature, JobFamilies.GITFLOW_FAMILY); + + + return null; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/GitFlowHandlerUtil.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/GitFlowHandlerUtil.java new file mode 100644 index 0000000000..d368c22ff1 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/GitFlowHandlerUtil.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.egit.core.internal.Utils; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * + */ +public class GitFlowHandlerUtil { + /** + * @param event + * @return Selected GitFlowRepository + */ + public static GitFlowRepository getRepository(ExecutionEvent event) { + IStructuredSelection selection = (IStructuredSelection) HandlerUtil + .getCurrentSelection(event); + PlatformObject firstElement = (PlatformObject) selection + .getFirstElement(); + Repository repository = Utils.getAdapter(firstElement, + Repository.class); + if (repository == null) { + return null; + } + return new GitFlowRepository(repository); + } + +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixFinishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixFinishHandler.java new file mode 100644 index 0000000000..487fb319fc --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixFinishHandler.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import static org.eclipse.egit.gitflow.ui.Activator.error; + +import java.io.IOException; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.WrongGitFlowStateException; +import org.eclipse.egit.gitflow.op.HotfixFinishOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; + +/** + * git flow hotfix finish + */ +public class HotfixFinishHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + + HotfixFinishOperation hotfixFinishOperation; + try { + hotfixFinishOperation = new HotfixFinishOperation(gfRepo); + JobUtil.scheduleUserWorkspaceJob(hotfixFinishOperation, + UIText.HotfixFinishHandler_finishingHotfix, + JobFamilies.GITFLOW_FAMILY); + } catch (WrongGitFlowStateException | CoreException | IOException e) { + return error(e.getMessage(), e); + } + + return null; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixPublishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixPublishHandler.java new file mode 100644 index 0000000000..a04b10333f --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixPublishHandler.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import org.eclipse.egit.gitflow.ui.internal.UIText; + +/** + * git flow hotfix finish + */ +public class HotfixPublishHandler extends AbstractPublishHandler { + @Override + protected String getProgressText() { + return UIText.HotfixPublishHandler_publishingHotfix; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixStartHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixStartHandler.java new file mode 100644 index 0000000000..552be9150b --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/HotfixStartHandler.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.op.HotfixStartOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; +import org.eclipse.egit.gitflow.ui.internal.validation.HotfixNameValidator; +import org.eclipse.jface.dialogs.InputDialog; +import org.eclipse.jface.window.Window; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * git flow hotfix start + */ +public class HotfixStartHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + + InputDialog inputDialog = new InputDialog( + HandlerUtil.getActiveShell(event), + UIText.HotfixStartHandler_provideHotfixName, + UIText.HotfixStartHandler_pleaseProvideANameForTheNewHotfix, + "", //$NON-NLS-1$ + new HotfixNameValidator(gfRepo)); + + if (inputDialog.open() != Window.OK) { + return null; + } + + final String hotfixName = inputDialog.getValue(); + HotfixStartOperation hotfixStartOperation = new HotfixStartOperation( + gfRepo, hotfixName); + JobUtil.scheduleUserWorkspaceJob(hotfixStartOperation, + UIText.HotfixStartHandler_startingNewHotfix, + JobFamilies.GITFLOW_FAMILY); + + return null; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/InitHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/InitHandler.java new file mode 100644 index 0000000000..c752944386 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/InitHandler.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.op.InitOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; + +/** + * git flow feature init + */ +public class InitHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + if (gfRepo == null) { + return null; + } + + InitOperation initOperation = new InitOperation(gfRepo.getRepository()); + JobUtil.scheduleUserWorkspaceJob(initOperation, + UIText.InitHandler_initializing, JobFamilies.GITFLOW_FAMILY); + + return null; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseFinishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseFinishHandler.java new file mode 100644 index 0000000000..b24f9f9d14 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseFinishHandler.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import static org.eclipse.egit.gitflow.ui.Activator.error; + +import java.io.IOException; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.WrongGitFlowStateException; +import org.eclipse.egit.gitflow.op.ReleaseFinishOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; + +/** + * git flow release finish + */ +public class ReleaseFinishHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + + ReleaseFinishOperation releaseFinishOperation; + try { + releaseFinishOperation = new ReleaseFinishOperation(gfRepo); + JobUtil.scheduleUserWorkspaceJob(releaseFinishOperation, + UIText.ReleaseFinishHandler_finishingRelease, + JobFamilies.GITFLOW_FAMILY); + } catch (WrongGitFlowStateException | CoreException | IOException e) { + return error(e.getMessage(), e); + } + + return null; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleasePublishHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleasePublishHandler.java new file mode 100644 index 0000000000..f05002b1bf --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleasePublishHandler.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import org.eclipse.egit.gitflow.ui.internal.UIText; + +/** + * git flow release finish + */ +public class ReleasePublishHandler extends AbstractPublishHandler { + @Override + protected String getProgressText() { + return UIText.ReleasePublishHandler_publishingRelease; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseStartHandler.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseStartHandler.java new file mode 100644 index 0000000000..7c48aee1bc --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/ReleaseStartHandler.java @@ -0,0 +1,103 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.actions; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.egit.core.internal.Utils; +import org.eclipse.egit.core.internal.job.JobUtil; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.egit.gitflow.WrongGitFlowStateException; +import org.eclipse.egit.gitflow.op.ReleaseStartOperation; +import org.eclipse.egit.gitflow.ui.internal.JobFamilies; +import org.eclipse.egit.gitflow.ui.internal.UIText; +import org.eclipse.egit.gitflow.ui.internal.validation.ReleaseNameValidator; +import org.eclipse.jface.dialogs.InputDialog; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.window.Window; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.revplot.PlotCommit; +import org.eclipse.jgit.revwalk.RevCommit; +import org.eclipse.team.ui.history.IHistoryView; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * git flow release start + */ +public class ReleaseStartHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); + final String startCommitSha1 = getStartCommit(event); + + InputDialog inputDialog = new InputDialog( + HandlerUtil.getActiveShell(event), + UIText.ReleaseStartHandler_provideReleaseName, + UIText.ReleaseStartHandler_provideANameForTheNewRelease, "", //$NON-NLS-1$ + new ReleaseNameValidator(gfRepo)); + + if (inputDialog.open() != Window.OK) { + return null; + } + + final String releaseName = inputDialog.getValue(); + + ReleaseStartOperation releaseStartOperation = new ReleaseStartOperation( + gfRepo, startCommitSha1, releaseName); + JobUtil.scheduleUserWorkspaceJob(releaseStartOperation, + UIText.ReleaseStartHandler_startingNewRelease, + JobFamilies.GITFLOW_FAMILY); + + return null; + } + + private String getStartCommit(ExecutionEvent event) + throws ExecutionException { + IStructuredSelection selection = (IStructuredSelection) HandlerUtil + .getCurrentSelection(event); + if (selection.getFirstElement() instanceof PlotCommit) { + RevCommit plotCommit = (RevCommit) selection.getFirstElement(); + return plotCommit.getName(); + } else { + GitFlowRepository gitFlowRepository = new GitFlowRepository(getRepository(event)); + RevCommit head; + try { + head = gitFlowRepository.findHead(); + } catch (WrongGitFlowStateException e) { + throw new ExecutionException(e.getMessage()); + } + return head.getName(); + } + } + + private Repository getRepository(ExecutionEvent event) + throws ExecutionException { + PlatformObject firstElement; + IStructuredSelection selection = (IStructuredSelection) HandlerUtil + .getCurrentSelection(event); + if (selection.getFirstElement() instanceof PlotCommit) { + IWorkbenchPart ap = HandlerUtil.getActivePartChecked(event); + if (ap instanceof IHistoryView) { + firstElement = (PlatformObject) ((IHistoryView) ap) + .getHistoryPage().getInput(); + } else { + // This is unexpected + return null; + } + + } else { + firstElement = (PlatformObject) selection.getFirstElement(); + } + return Utils.getAdapter(firstElement, Repository.class); + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractGitFlowBranchSelectionDialog.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractGitFlowBranchSelectionDialog.java new file mode 100644 index 0000000000..43a5ac7317 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractGitFlowBranchSelectionDialog.java @@ -0,0 +1,155 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.dialog; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.egit.ui.internal.CommonUtils; +import org.eclipse.egit.ui.internal.GitLabelProvider; +import static org.eclipse.jface.dialogs.IDialogConstants.*; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.IBaseLabelProvider; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerComparator; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; + +/** + * Select Git Flow branches. + * + * @param <T> + */ +public abstract class AbstractGitFlowBranchSelectionDialog<T> extends MessageDialog { + + private final List<T> nodes; + + private TableViewer branchesList; + + private List<T> selected = new ArrayList<T>(); + + /** + * @param parentShell + * @param nodes + * @param title + * @param message + */ + public AbstractGitFlowBranchSelectionDialog(Shell parentShell, List<T> nodes, + String title, String message) { + super(parentShell, title, null, message, MessageDialog.QUESTION, + new String[] { OK_LABEL, CANCEL_LABEL }, 0); + this.nodes = nodes; + } + + @Override + protected boolean isResizable() { + return true; + } + + @Override + protected Control createCustomArea(Composite parent) { + Composite area = new Composite(parent, SWT.NONE); + GridDataFactory.fillDefaults().grab(true, true).span(2, 1) + .applyTo(area); + area.setLayout(new GridLayout(1, false)); + branchesList = new TableViewer(area, SWT.SINGLE | SWT.H_SCROLL + | SWT.V_SCROLL | SWT.BORDER); + GridDataFactory.fillDefaults().grab(true, true) + .applyTo(branchesList.getControl()); + branchesList.setContentProvider(ArrayContentProvider.getInstance()); + branchesList.setLabelProvider(createLabelProvider()); + branchesList.setComparator(new ViewerComparator( + CommonUtils.STRING_ASCENDING_COMPARATOR)); + branchesList.setInput(nodes); + branchesList + .addSelectionChangedListener(new ISelectionChangedListener() { + @Override + public void selectionChanged(SelectionChangedEvent event) { + checkPage(); + } + }); + branchesList.addDoubleClickListener(new IDoubleClickListener() { + @Override + public void doubleClick(DoubleClickEvent event) { + buttonPressed(OK); + } + }); + + branchesList.addFilter(createFilter()); + return area; + } + + private ViewerFilter createFilter() { + return new ViewerFilter() { + @Override + public boolean select(Viewer viewer, Object parentElement, + Object element) { + return true; + } + }; + } + + private IBaseLabelProvider createLabelProvider() { + final String prefix = getPrefix(); + return new GitLabelProvider() { + @Override + public String getText(Object element) { + return super.getText(element).substring(prefix.length()); + } + }; + } + + /** + * @return Git Flow prefix for this dialog. E.g. feature, release, hotfix + */ + abstract protected String getPrefix(); + + private void checkPage() { + getButton(OK).setEnabled(!branchesList.getSelection().isEmpty()); + + } + + @SuppressWarnings("unchecked") + @Override + protected void buttonPressed(int buttonId) { + if (buttonId == OK) { + selected = ((IStructuredSelection) branchesList.getSelection()) + .toList(); + } + super.buttonPressed(buttonId); + } + + @Override + public void create() { + super.create(); + getButton(OK).setEnabled(false); + } + + /** + * @return the selected entry (single mode) + */ + public T getSelectedNode() { + if (selected.isEmpty()) { + return null; + } + return selected.get(0); + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java new file mode 100644 index 0000000000..1609d64e34 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.factories; + +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.egit.core.internal.Utils; +import org.eclipse.egit.core.project.RepositoryMapping; +import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode; +import org.eclipse.jgit.lib.Repository; + +/** + * Get JGit repository for element selected in Git Flow UI. + */ +public class GitFlowAdapterFactory implements IAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public Object getAdapter(Object adaptableObject, Class adapterType) { + Repository repository = null; + if (adaptableObject instanceof IResource) { + IResource resource = (IResource) adaptableObject; + RepositoryMapping repositoryMapping = RepositoryMapping + .getMapping(resource.getProject()); + repository = repositoryMapping.getRepository(); + } else if (adaptableObject instanceof PlatformObject) { + PlatformObject platformObject = (PlatformObject) adaptableObject; + repository = Utils.getAdapter(platformObject, Repository.class); + } else { + throw new IllegalStateException(); + } + + return repository; + } + + @SuppressWarnings("unchecked") + @Override + public Class[] getAdapterList() { + return new Class[] { IResource.class, RepositoryTreeNode.class }; + } + +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/selection/SelectionPropertyTester.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/selection/SelectionPropertyTester.java new file mode 100644 index 0000000000..2043fa1446 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/selection/SelectionPropertyTester.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.selection; + +import static org.eclipse.egit.gitflow.ui.Activator.error; + +import java.io.IOException; + +import org.eclipse.core.expressions.PropertyTester; +import org.eclipse.egit.gitflow.Activator; +import org.eclipse.egit.gitflow.GitFlowRepository; +import org.eclipse.jgit.lib.Repository; + +/** + * Testing Git Flow states. + */ +public class SelectionPropertyTester extends PropertyTester { + private static final String IS_MASTER = "isMaster"; //$NON-NLS-1$ + + private static final String IS_DEVELOP = "isDevelop"; //$NON-NLS-1$ + + private static final String IS_HOTFIX = "isHotfix"; //$NON-NLS-1$ + + private static final String IS_RELEASE = "isRelease"; //$NON-NLS-1$ + + private static final String IS_INITIALIZED = "isInitialized"; //$NON-NLS-1$ + + private static final String IS_FEATURE = "isFeature"; //$NON-NLS-1$ + + private static final String HAS_DEFAULT_REMOTE = "hasDefaultRemote"; //$NON-NLS-1$ + + @Override + public boolean test(Object receiver, String property, Object[] args, + Object expectedValue) { + Repository repository = (Repository) receiver; + + GitFlowRepository gitFlowRepository = new GitFlowRepository(repository); + try { + if (IS_INITIALIZED.equals(property)) { + return gitFlowRepository.getConfig().isInitialized(); + } else if (IS_FEATURE.equals(property)) { + return gitFlowRepository.isFeature(); + } else if (IS_RELEASE.equals(property)) { + return gitFlowRepository.isRelease(); + } else if (IS_HOTFIX.equals(property)) { + return gitFlowRepository.isHotfix(); + } else if (IS_DEVELOP.equals(property)) { + return gitFlowRepository.isDevelop(); + } else if (IS_MASTER.equals(property)) { + return gitFlowRepository.isMaster(); + } else if (HAS_DEFAULT_REMOTE.equals(property)) { + return gitFlowRepository.getConfig().hasDefaultRemote(); + } + } catch (IOException e) { + Activator.getDefault().getLog().log(error(e.getMessage(), e)); + } + return false; + } +} diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/uitext.properties b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/uitext.properties new file mode 100644 index 0000000000..340dc57bd6 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/uitext.properties @@ -0,0 +1,41 @@ +############################################################################### +# Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> +# +# 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 +############################################################################### +FeatureFinishHandler_finishingFeature=Finishing feature... +FeatureRebaseHandler_conflicts=Conflicts +FeatureRebaseHandler_rebaseFailed=Rebase failed. +FeatureRebaseHandler_rebasingFeature=Rebasing feature... +FeatureRebaseHandler_resolveConflictsManually=There are conflicts that need to be resolve manually. Add your changes and continue rebase when you are finished. +FeatureStartHandler_pleaseProvideANameForTheNewFeature=Please provide a name for the new feature. +FeatureStartHandler_provideFeatureName=Provide feature name +FeatureStartHandler_startingNewFeature=Starting new Feature... +FeatureTrackHandler_fetchingRemoteFeatures=Fetching remote features... +FeatureTrackHandler_noRemoteFeatures=No remote features +FeatureTrackHandler_noRemoteFeaturesFoundOnTheConfiguredRemote=No features were found on the configured remote. +FeatureTrackHandler_remoteFeatures=Remote features: +FeatureTrackHandler_selectFeature=Select Feature +FeatureTrackHandler_trackingFeature=Tracking feature... +HotfixFinishHandler_finishingHotfix=Finishing hotfix... +HotfixStartHandler_pleaseProvideANameForTheNewHotfix=Please provide a name for the new hotfix. +HotfixStartHandler_provideHotfixName=Provide hotfix name +HotfixStartHandler_startingNewHotfix=Starting new Hotfix... +InitHandler_initializing=Initializing... +ReleaseFinishHandler_finishingRelease=Finishing release... +ReleaseStartHandler_provideANameForTheNewRelease=Please provide a name for the new release. +ReleaseStartHandler_provideReleaseName=Provide release name +ReleaseStartHandler_startingNewRelease=Starting new Release... +FeatureCheckoutHandler_checkingOutFeature=Checking out feature... +FeatureCheckoutHandler_localFeatures=Local features: +FeatureCheckoutHandler_selectFeature=Select Feature +FeaturePublishHandler_publishingFeature=Publishing feature... +ReleasePublishHandler_publishingRelease=Publishing release... +HotfixPublishHandler_publishingHotfix=Publishing hotfix... +NameValidator_invalidName='%s' is not a valid name. None of the following characters is allowed: '%s' +NameValidator_nameAlreadyExists=Name '%s' already exists +FeatureCheckoutHandler_cleanupDialog_title=Cannot Rebase Repository ''{0}'' +FeatureCheckoutHandler_cleanupDialog_text=You have uncommitted changes. Either commit the changes, stash the changes, or discard the changes by resetting the current branch. diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/BranchNameInputValidator.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/BranchNameInputValidator.java new file mode 100644 index 0000000000..2e0d337c58 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/BranchNameInputValidator.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.validation; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.gitflow.BranchNameValidator; +import org.eclipse.egit.gitflow.ui.internal.UIText; +import org.eclipse.jface.dialogs.IInputValidator; + +/** + * Validates Git Flow branch names. + */ +abstract public class BranchNameInputValidator implements IInputValidator { + @Override + public String isValid(String newText) { + try { + if (branchExists(newText)) { + return String.format(UIText.NameValidator_nameAlreadyExists, + newText); + } + if (!BranchNameValidator.isBranchNameValid(newText)) { + return String.format(UIText.NameValidator_invalidName, newText, + BranchNameValidator.ILLEGAL_CHARS); + } + } catch (CoreException e) { + return null; + } + return null; + } + + /** + * @param newText + * @return Whether or not newText corresponds to an existing branch. + * @throws CoreException + */ + abstract protected boolean branchExists(String newText) + throws CoreException; +}
\ No newline at end of file diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/FeatureNameValidator.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/FeatureNameValidator.java new file mode 100644 index 0000000000..d12951bb44 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/FeatureNameValidator.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.validation; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.gitflow.BranchNameValidator; +import org.eclipse.egit.gitflow.GitFlowRepository; + +/** + * Validate feature branch name. + */ +public class FeatureNameValidator extends BranchNameInputValidator { + private final GitFlowRepository repository; + + /** + * @param gfRepo + */ + public FeatureNameValidator(GitFlowRepository gfRepo) { + this.repository = gfRepo; + } + + @Override + protected boolean branchExists(String newText) throws CoreException { + return BranchNameValidator.featureExists(repository, newText); + } +}
\ No newline at end of file diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/HotfixNameValidator.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/HotfixNameValidator.java new file mode 100644 index 0000000000..75ffdbb366 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/HotfixNameValidator.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.validation; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.gitflow.BranchNameValidator; +import org.eclipse.egit.gitflow.GitFlowRepository; + +/** + * Validate name of hotfix branch. + */ +public class HotfixNameValidator extends BranchNameInputValidator { + private final GitFlowRepository repository; + + /** + * @param repository + */ + public HotfixNameValidator(GitFlowRepository repository) { + this.repository = repository; + } + + @Override + protected boolean branchExists(String newText) throws CoreException { + return BranchNameValidator.hotfixExists(repository, newText); + } +}
\ No newline at end of file diff --git a/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/ReleaseNameValidator.java b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/ReleaseNameValidator.java new file mode 100644 index 0000000000..c371413a20 --- /dev/null +++ b/org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/ReleaseNameValidator.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (C) 2015, Max Hohenegger <eclipse@hohenegger.eu> + * + * 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.egit.gitflow.ui.internal.validation; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.egit.gitflow.BranchNameValidator; +import org.eclipse.egit.gitflow.GitFlowRepository; + +/** + * Validate release branch name. + */ +public class ReleaseNameValidator extends BranchNameInputValidator { + private final GitFlowRepository repository; + + /** + * @param gfRepo + */ + public ReleaseNameValidator(GitFlowRepository gfRepo) { + this.repository = gfRepo; + } + + @Override + protected boolean branchExists(String newText) throws CoreException { + return BranchNameValidator.releaseExists(repository, newText); + } +}
\ No newline at end of file |